Add support for a new command 'emsdk deactivate' (#1593)
Add support for a new command 'emsdk deactivate' that can be used to remove a tool from the active list. Since the big endian cross compile Node.js is added to `NODE_JS_TEST` instead of `NODE_JS`, there needs to be a way to deactivate it for regular runs. This PR adds a `emsdk deactivate` command to enable doing that.
This commit is contained in:
14
emsdk.py
14
emsdk.py
@@ -2838,6 +2838,9 @@ def main(args):
|
|||||||
--override-repository emscripten-main@https://github.com/<fork>/emscripten/tree/<refspec>
|
--override-repository emscripten-main@https://github.com/<fork>/emscripten/tree/<refspec>
|
||||||
|
|
||||||
|
|
||||||
|
emsdk deactivate tool/sdk - Removes the given tool or SDK from the current set of activated tools.
|
||||||
|
|
||||||
|
|
||||||
emsdk uninstall <tool/sdk> - Removes the given tool or SDK from disk.''')
|
emsdk uninstall <tool/sdk> - Removes the given tool or SDK from disk.''')
|
||||||
|
|
||||||
if WINDOWS:
|
if WINDOWS:
|
||||||
@@ -3107,7 +3110,7 @@ def main(args):
|
|||||||
elif cmd == 'update-tags':
|
elif cmd == 'update-tags':
|
||||||
errlog('`update-tags` is not longer needed. To install the latest tot release just run `install tot`')
|
errlog('`update-tags` is not longer needed. To install the latest tot release just run `install tot`')
|
||||||
return 0
|
return 0
|
||||||
elif cmd == 'activate':
|
elif cmd == 'activate' or cmd == 'deactivate':
|
||||||
if arg_permanent:
|
if arg_permanent:
|
||||||
print('Registering active Emscripten environment permanently')
|
print('Registering active Emscripten environment permanently')
|
||||||
print('')
|
print('')
|
||||||
@@ -3119,7 +3122,14 @@ def main(args):
|
|||||||
tool = find_sdk(arg)
|
tool = find_sdk(arg)
|
||||||
if tool is None:
|
if tool is None:
|
||||||
error_on_missing_tool(arg)
|
error_on_missing_tool(arg)
|
||||||
tools_to_activate += [tool]
|
|
||||||
|
if cmd == 'activate':
|
||||||
|
tools_to_activate += [tool]
|
||||||
|
elif tool in tools_to_activate:
|
||||||
|
print('Deactivating tool ' + str(tool) + '.')
|
||||||
|
tools_to_activate.remove(tool)
|
||||||
|
else:
|
||||||
|
print('Tool "' + arg + '" was not active, no need to deactivate.')
|
||||||
if not tools_to_activate:
|
if not tools_to_activate:
|
||||||
errlog('No tools/SDKs specified to activate! Usage:\n emsdk activate tool/sdk1 [tool/sdk2] [...]')
|
errlog('No tools/SDKs specified to activate! Usage:\n emsdk activate tool/sdk1 [tool/sdk2] [...]')
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user