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

Shims created for batch scripts on Windows don't run the batch script #45

Open
kcastellino opened this issue Jun 24, 2023 · 0 comments · May be fixed by #46
Open

Shims created for batch scripts on Windows don't run the batch script #45

kcastellino opened this issue Jun 24, 2023 · 0 comments · May be fixed by #46

Comments

@kcastellino
Copy link

Shims created for .cmd and .bat files don't call cmd.exe with the required flags to actually run the script. To run a script, the script path needs to be preceded with the /C (or /K) flags. I have attached a sample batch file shim generated by pnpm, but the issue also affects the PowerShell and shell scripts.

@SETLOCAL
@IF EXIST "%~dp0\cmd.exe" (
  "%~dp0\cmd.exe"  "%~dp0\global\5\node_modules\sass-embedded-win32-x64\dart-sass\sass.bat" %*
) ELSE (
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  cmd  "%~dp0\global\5\node_modules\sass-embedded-win32-x64\dart-sass\sass.bat" %*
)

The cmd call in line 6 (as well as line 3) above needs to include the /C flag, as below:

cmd /C "%~dp0\global\5\node_modules\sass-embedded-win32-x64\dart-sass\sass.bat" %*
@kcastellino kcastellino changed the title Shims created for batch scripts don't actually run the batch script Shims created for batch scripts on Windows don't actually run the batch script Jun 24, 2023
@kcastellino kcastellino changed the title Shims created for batch scripts on Windows don't actually run the batch script Shims created for batch scripts on Windows don't run the batch script Jun 24, 2023
@kcastellino kcastellino linked a pull request Jun 26, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant