If attempting to use 'emsdk update' when bootstrapped via git clone, show a more helpful error message to avoid a gotcha of overriding git repository with older version.

This commit is contained in:
Jukka Jylänki
2017-03-22 21:31:47 +02:00
parent ad51a170a6
commit 836d2ce941

5
emsdk
View File

@@ -1463,6 +1463,11 @@ def fetch_emscripten_tags():
download_file('https://s3.amazonaws.com/mozilla-games/emscripten/packages/emscripten/nightly/' + os_name_for_emscripten_location() + '/index.txt', 'emscripten-nightlies.txt', download_even_if_exists=True)
def update_emsdk():
if os.path.exists(os.path.join(emsdk_path(), '.git')):
print('You seem to have bootstrapped Emscripten SDK by cloning from GitHub. In this case, use "git pull" instead of "emsdk update" to update emsdk. (Not doing that automatically in case you have local changes)', file=sys.stderr)
print('Alternatively, use "emsdk update-tags" to refresh the latest list of tags from the different Git repositories.', file=sys.stderr)
sys.exit(1)
sys.exit(0)
if WINDOWS:
download_and_unzip(urljoin(emsdk_packages_url, 'emsdk_windows_update.zip'), emsdk_path(), download_even_if_exists=True)
rmfile('zips/emsdk_windows_update.zip')