Skip to content

Commit 42df95d

Browse files
committed
fix: set proper JBANG_LAUNCH_CMD in jbang.cmd
It would only set the name of the command, which would make it impossible to figure out its location. The ps1 version would always give an absolute path, while the bash version would give a path relative to the current directory.
1 parent ce35dd8 commit 42df95d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scripts/jbang.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if "!JAVA_EXEC!"=="" (
6060
)
6161

6262
set JBANG_RUNTIME_SHELL=cmd
63-
set JBANG_LAUNCH_CMD=%~nx0
63+
set JBANG_LAUNCH_CMD=%~f0
6464
rem tell jbang whether stdin is a tty or not
6565
2>nul >nul timeout /t 0 && (set JBANG_STDIN_NOTTY=false) || (set JBANG_STDIN_NOTTY=true)
6666
set "CMD=!JAVA_EXEC!"

0 commit comments

Comments
 (0)