Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3047,13 +3047,12 @@ def print_tools(t):
print('')

tools_to_activate = currently_active_tools()
args = [x for x in args if not x.startswith('--')]
for arg in args:
tool = find_tool(arg)
if tool is None:
tool = find_sdk(arg)
if tool is None:
error_on_missing_tool(arg)
if tool is None:
error_on_missing_tool(arg)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this means that args of the form --arg will now go through this missing tool logic. Does it print a message that makes sense for non-tool args?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you will not see no tool found: --arg rather than silently ignoring it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right sorry, I guess what I meant was, should the error message be generalized to something like "unknown argument or no tool found by that name", since the error could now be either one of those cases.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other command like emsdk install already report error: tool or SDK not found: '--foo'.. we could perhaps make that nicer, but that seems separate (and less important?) to ignoring args.

tools_to_activate += [tool]
if not tools_to_activate:
errlog('No tools/SDKs specified to activate! Usage:\n emsdk activate tool/sdk1 [tool/sdk2] [...]')
Expand Down
3 changes: 1 addition & 2 deletions test/test_activation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ try {

& "$repo_root/emsdk.ps1" install latest

$esc = '--%'
& "$repo_root/emsdk.ps1" activate latest $esc $env:PERMANENT_FLAG $env:SYSTEM_FLAG
& "$repo_root/emsdk.ps1" activate latest $env:PERMANENT_FLAG $env:SYSTEM_FLAG

if ($env:SYSTEM_FLAG) {
$env_type = "Machine"
Expand Down