Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error message when trying to run a nonexistent path #3407
Fix error message when trying to run a nonexistent path #3407
Changes from 2 commits
07f5aba
c29ee26
ea26f95
a2e9496
0888e5a
6555e5e
c357571
7de0210
c15adf1
b4b84be
6d3aeb4
26f4b43
92cefac
4ee0c97
8ca5a5b
8892a61
de7118d
627285d
6cb47c1
2a4e91a
71ff457
9af38d1
8cb9fca
9751fbc
f633e61
ab6f6b9
50c75d4
7a48f96
7c3b0eb
a7ff5db
cb312bc
4010316
886392f
5d40796
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would approach this differently:
first, try to normalize the argument with
Path::canonicalize()
Then, check if it's a valid file that exists ( and has a .wasm or .wat extension?), and run it if that's the case
(there is already similar logic above, but only for cases where there is a
wapm.toml
)If that doesn't work, try to parse it as a package identifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add on top. If is not "parseable" as a package identifier, it should not fall back into the registry.
Basically, here's the logic:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to follow this logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for us in the future: we can enforce that namespaces exists always (for now), as a tradeoff towards simplification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no namespace is given, we assume the namespace as being
_