Skip to content
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

Bypassing the cross-platform commands (when sh -c is inadequate) #308

Open
jeff-hykin opened this issue Feb 20, 2025 · 0 comments
Open

Bypassing the cross-platform commands (when sh -c is inadequate) #308

jeff-hykin opened this issue Feb 20, 2025 · 0 comments

Comments

@jeff-hykin
Copy link

I need to call the deno that's on the user's PATH (which is not the Deno.execPath())

I love the auto cross-platform commands.
99% of the time I do want $`deno` to be equivalent to $`${Deno.execPath()}` ).
I am super glad for them to be the default.

That said

  1. Default means there's a way to use non-defaults. (hardcoded ≠ default)
  2. It'd be nice to mention the shimmed deno behavior (took a bit to debug why the deno version was different from PATH)

Failed Workarounds

  1. Absolute path: Usually, I'd get the absolute path to the PATH deno via which... but it appears dax also shims the output of which to return Deno.execPath() instead of the deno on PATH. I'm less thrilled about this behavior... but it is defend-able so I'm not going to ask for it to be changed. It does cause this workaround to fail though
  2. sh -c fails as a workaround, both because the script needs to work cross platform, and because invoking a shell changes ENV vars (like SHLVL) which can affect commands I'm trying to run.

TLDR

Please consider an api like $.sys`deno --version` which bypasses the cross platform commands, and shimmed commands.

If that api is within scope, I'd be happy to give a shot at implementing it.

Extra / Maybe Bug

I don't know if this is intended behavior but $.raw will bypass the deno shim... but not the cross-platform commands. As a user I would expect either both were ignored, or neither.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant