Skip to content

Commit 03db573

Browse files
committed
Support %dp0% as well as %~dp0
We have to set the base dir in a subroutine to fix npm/cmd-shim#10
1 parent 31a1275 commit 03db573

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function extractPath (path, cmdshimContents) {
1010
}
1111

1212
function extractPathFromCmd (cmdshimContents) {
13-
var matches = cmdshimContents.match(/"%~dp0\\([^"]+?)"\s+%[*]/)
13+
var matches = cmdshimContents.match(/"%(?:~dp0|dp0%)\\([^"]+?)"\s+%[*]/)
1414
return matches && matches[1]
1515
}
1616

0 commit comments

Comments
 (0)