For conveniency, if user calls 'emsdk activate', activate the latest versions of ALL installed tools.

This commit is contained in:
Jukka Jylänki
2013-11-20 13:09:51 +02:00
parent 1b46753cb3
commit 03ed83c3fa

23
emsdk
View File

@@ -891,18 +891,19 @@ def main():
update_emsdk() update_emsdk()
return 0 return 0
elif cmd == 'activate': elif cmd == 'activate':
# If called without arguments, activate latest versions of all tools
if len(sys.argv) <= 2: if len(sys.argv) <= 2:
print "Missing parameter. Type 'emsdk activate <tool name>' to install a tool or an SDK. Type 'emsdk list' to obtain a list of available tools. Type 'emsdk install latest' to automatically install the newest version of the SDK." tools_to_activate = list(tools)
return 1 else:
tools_to_activate = currently_active_tools() tools_to_activate = currently_active_tools()
for i in range(2, len(sys.argv)): for i in range(2, len(sys.argv)):
tool = find_tool(sys.argv[i]) tool = find_tool(sys.argv[i])
if tool == None: if tool == None:
tool = find_sdk(sys.argv[i]) tool = find_sdk(sys.argv[i])
if tool == None: if tool == None:
print "Error: No tool or SDK found by name '" + sys.argv[i] + "'." print "Error: No tool or SDK found by name '" + sys.argv[i] + "'."
return 1 return 1
tools_to_activate += [tool] tools_to_activate += [tool]
set_active_tools(tools_to_activate) set_active_tools(tools_to_activate)
return 0 return 0
elif cmd == 'install': elif cmd == 'install':