Skip to content

Commit

Permalink
Support %dp0% as well as %~dp0
Browse files Browse the repository at this point in the history
We have to set the base dir in a subroutine to fix
npm/cmd-shim#10
  • Loading branch information
isaacs committed Aug 14, 2019
1 parent 31a1275 commit 03db573
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -10,7 +10,7 @@ function extractPath (path, cmdshimContents) {
}

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

Expand Down

0 comments on commit 03db573

Please sign in to comment.