Skip to content

Commit

Permalink
fix npm#35: always set $basedir for win32 bash
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ ONeal committed Aug 10, 2019
1 parent 75edc98 commit eb8f5fb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,14 @@ function writeShim_ (from, to, prog, args, cb) {
// exit $ret

var sh = "#!/bin/sh\n"
+ "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n"
+ "\n"
+ "case `uname` in\n"
+ " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n"
+ "esac\n"
+ "\n"

if (shLongProg) {
sh = sh
+ "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n"
+ "\n"
+ "case `uname` in\n"
+ " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n"
+ "esac\n"
+ "\n"

sh = sh
+ "if [ -x "+shLongProg+" ]; then\n"
+ " " + shLongProg + " " + args + " " + shTarget + " \"$@\"\n"
Expand Down

0 comments on commit eb8f5fb

Please sign in to comment.