Skip to content

Commit

Permalink
fix: regression introduced due to broken batch file label syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Aug 21, 2019
1 parent a9ea3f8 commit 9e85c82
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ function writeShim_ (from, to, prog, args, variables, cb) {
// Subroutine trick to fix https://github.com/npm/cmd-shim/issues/10
var head = '@ECHO off\r\n' +
'SETLOCAL\r\n' +
'CALL find_dp0\r\n'
'CALL :find_dp0\r\n'
var foot = 'ENDLOCAL\r\n' +
'EXIT /b\r\n' +
'find_dp0:\r\n' +
':find_dp0\r\n' +
'SET dp0=%~dp0\r\n' +
'EXIT /b\r\n'

Expand Down
32 changes: 16 additions & 16 deletions tap-snapshots/test-basic.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
exports[`test/basic.js TAP env shebang > cmd 1`] = `
@ECHO off\\r
SETLOCAL\\r
CALL find_dp0\\r
CALL :find_dp0\\r
\\r
IF EXIST "%dp0%\\node.exe" (\\r
SET "_prog=%dp0%\\node.exe"\\r
Expand All @@ -20,7 +20,7 @@ IF EXIST "%dp0%\\node.exe" (\\r
"%_prog%" "%dp0%\\from.env" %*\\r
ENDLOCAL\\r
EXIT /b\\r
find_dp0:\\r
:find_dp0\\r
SET dp0=%~dp0\\r
EXIT /b\\r
Expand Down Expand Up @@ -70,7 +70,7 @@ exit $ret
exports[`test/basic.js TAP env shebang with args > cmd 1`] = `
@ECHO off\\r
SETLOCAL\\r
CALL find_dp0\\r
CALL :find_dp0\\r
\\r
IF EXIST "%dp0%\\node.exe" (\\r
SET "_prog=%dp0%\\node.exe"\\r
Expand All @@ -82,7 +82,7 @@ IF EXIST "%dp0%\\node.exe" (\\r
"%_prog%" --expose_gc "%dp0%\\from.env.args" %*\\r
ENDLOCAL\\r
EXIT /b\\r
find_dp0:\\r
:find_dp0\\r
SET dp0=%~dp0\\r
EXIT /b\\r
Expand Down Expand Up @@ -132,7 +132,7 @@ exit $ret
exports[`test/basic.js TAP env shebang with variables > cmd 1`] = `
@ECHO off\\r
SETLOCAL\\r
CALL find_dp0\\r
CALL :find_dp0\\r
@SET NODE_PATH=./lib:%NODE_PATH%\\r
\\r
IF EXIST "%dp0%\\node.exe" (\\r
Expand All @@ -145,7 +145,7 @@ IF EXIST "%dp0%\\node.exe" (\\r
"%_prog%" "%dp0%\\from.env.variables" %*\\r
ENDLOCAL\\r
EXIT /b\\r
find_dp0:\\r
:find_dp0\\r
SET dp0=%~dp0\\r
EXIT /b\\r
Expand Down Expand Up @@ -195,7 +195,7 @@ exit $ret
exports[`test/basic.js TAP explicit shebang > cmd 1`] = `
@ECHO off\\r
SETLOCAL\\r
CALL find_dp0\\r
CALL :find_dp0\\r
\\r
IF EXIST "%dp0%\\/usr/bin/sh.exe" (\\r
SET "_prog=%dp0%\\/usr/bin/sh.exe"\\r
Expand All @@ -207,7 +207,7 @@ IF EXIST "%dp0%\\/usr/bin/sh.exe" (\\r
"%_prog%" "%dp0%\\from.sh" %*\\r
ENDLOCAL\\r
EXIT /b\\r
find_dp0:\\r
:find_dp0\\r
SET dp0=%~dp0\\r
EXIT /b\\r
Expand Down Expand Up @@ -257,7 +257,7 @@ exit $ret
exports[`test/basic.js TAP explicit shebang with args > cmd 1`] = `
@ECHO off\\r
SETLOCAL\\r
CALL find_dp0\\r
CALL :find_dp0\\r
\\r
IF EXIST "%dp0%\\/usr/bin/sh.exe" (\\r
SET "_prog=%dp0%\\/usr/bin/sh.exe"\\r
Expand All @@ -269,7 +269,7 @@ IF EXIST "%dp0%\\/usr/bin/sh.exe" (\\r
"%_prog%" -x "%dp0%\\from.sh.args" %*\\r
ENDLOCAL\\r
EXIT /b\\r
find_dp0:\\r
:find_dp0\\r
SET dp0=%~dp0\\r
EXIT /b\\r
Expand Down Expand Up @@ -319,11 +319,11 @@ exit $ret
exports[`test/basic.js TAP if exists (it does exist) > cmd 1`] = `
@ECHO off\\r
SETLOCAL\\r
CALL find_dp0\\r
CALL :find_dp0\\r
"%dp0%\\from.exe" %*\\r
ENDLOCAL\\r
EXIT /b\\r
find_dp0:\\r
:find_dp0\\r
SET dp0=%~dp0\\r
EXIT /b\\r
Expand Down Expand Up @@ -360,11 +360,11 @@ exit $?
exports[`test/basic.js TAP just proceed if reading fails > cmd 1`] = `
@ECHO off\\r
SETLOCAL\\r
CALL find_dp0\\r
CALL :find_dp0\\r
"%dp0%\\" %*\\r
ENDLOCAL\\r
EXIT /b\\r
find_dp0:\\r
:find_dp0\\r
SET dp0=%~dp0\\r
EXIT /b\\r
Expand Down Expand Up @@ -401,11 +401,11 @@ exit $?
exports[`test/basic.js TAP no shebang > cmd 1`] = `
@ECHO off\\r
SETLOCAL\\r
CALL find_dp0\\r
CALL :find_dp0\\r
"%dp0%\\from.exe" %*\\r
ENDLOCAL\\r
EXIT /b\\r
find_dp0:\\r
:find_dp0\\r
SET dp0=%~dp0\\r
EXIT /b\\r
Expand Down

0 comments on commit 9e85c82

Please sign in to comment.