-
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
In deno tasks, automatically add $DENO_DIR/bin
to PATH
#23078
Comments
That's strange. There's special logic to use the current executing version of deno for the What was the error they saw? Are they using the latest version of Deno? |
Looking at the output more carefully, it seems like the failed execution is in a shebang.
Modifying the environment instead of special-casing in the shell would make this work. On the other hand, I don't think that shebang will work on Windows anyway, and I should definitely change it. |
bin/denizen.ts: #!/usr/bin/env -S deno run -A --unstable
import { app } from '../lib/denizen.ts'
Deno.serve({
hostname: '0.0.0.0',
port: Deno.env.has('PORT') ? Number(Deno.env.get('PORT')) : undefined,
}, app.fetch) |
It's a good point that it might be better to add the executing directory of deno to the shell path because then it would work when a sub process executes Deno too.
I can implement denoland/deno_task_shell#23 -- will try to do it tomorrow as I'd like to get that in the minor release on Thursday. |
(Should this issue be in the deno_task_shell repo? Apologies if so.)
I am writing a Deno web app intended to be run by people who might not otherwise use Deno. I use Deno tasks for starting the server.
A user had downloaded Deno but hadn't added it to their PATH, and was trying to run the project with the command
~/.deno/bin/deno task run
, which failed since therun
task calls Deno recursively.As far as I can tell, my tasks cannot predict where Deno will be downloaded, and (I assume?) calling Deno within tasks is a common use case.
I propose that the Deno installation directory be prepended to the PATH environment variable before running tasks. This will work for tasks, shell scripts and shebangs since they all will inherit the environment from the
deno task
process.The text was updated successfully, but these errors were encountered: