-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
map "deno run X" to "deno task X" if X is not a script #24307
Comments
Hello, I'm trying to invistegate this featuer, maybe i can work on it. We need to see if the X 'deno execute X' is not a script by checking if it not has any endings with '.ts || .js' I will print a message to inform 'the X it was task not script' and then run 'deno task X', but from where it would search on task? I believe it should exist deno.json to specify the tasks. do you have some behavior or expected logic of it task? |
@ry [cli\main.rs:347:7] &err = CustomError { Please let me know whether I can use this solution or tell me what to expect. |
This method is flawed. A file doesn't need an extension or could have a different extension and still be valid JavaScript/TypeScript code.
Either deno.json or deno.jsonc |
@BlackAsLight so,Can we modify the Custom Error in deno_core to return 'class' attribute that will help determine script not found? Then, if it is 'not found' and the flag it 'run', it will map it to task. [cli\main.rs:347:7] &err = CustomError { Please let me know whether I can use this solution or tell me what to expect. |
I'm against this. Letting |
The problem is that I have a task that is not a script. If there are no extensions, I will map it directly. or if this script does not exist, we will need to run it as a task, so we will try to run it first, and if we get a module not found error, we will try the task.? |
will require changes across the stack to properly detect if module is not found. When I tried that before it didn't work well relying on just error message
deno_graph and probably deno_npm need to return concrete error types and not be casted to a generic AnyError
The text was updated successfully, but these errors were encountered: