-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
🙏🏻 [feat/req] supply $0/%0 to shimmed scripts (cross-platform) #9874
Labels
feat
new feature (which has been agreed to/accepted)
Comments
As an example of an implementation used locally: % generated by deno install (revised locally) %
@set "ERRORLEVEL="
@setLocal
@set _DENO_SHIM_0_=%0
@set _DENO_SHIM_*_=%*
@deno.exe "run" "--allow-read" "--allow-write" "--allow-net" "--allow-env" "--allow-run" "--allow-plugin" "--allow-hrtime" "file:///C:/Users/Roy/OneDrive/Projects/deno/dexter/repo.deno.dexter/src/cli/dexter.ts" %*
@goto _undefined_ 2>NUL || @for %%G in ("%COMSPEC%") do @title %%~nG & @"%COMSPEC%" /d/c "@exit %ERRORLEVEL%" It works, but it requires revising the default shim and definitely feels like a bit of a "hack". |
The complementary POSIX shim would only need one additional line: _DENO_SHIM_0_=$0
deno "run" "--allow-read" "--allow-write" "--allow-net" "--allow-env" "--allow-run" "--allow-plugin" "--allow-hrtime" "file:///C:/Users/Roy/OneDrive/Projects/deno/dexter/repo.deno.dexter/src/cli/dexter.ts" "$@" |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Not stale. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's helpful to supply users with exact, functional command line constructions when giving feedback (via error message suggestions,
--help
or--usage
) about correct execution of a utility. Unfortunately, the initiating command ($0 or %0 for windows) is lost in the current shimming process, so the called script doesn't known the command that actually initiated it. The shims can be hacked to provide this information via environment variables or a command line option, but it would be better to have a formalized supplier for that information.The text was updated successfully, but these errors were encountered: