Skip to content

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

@kcastellino

Description

@kcastellino

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" %*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions