my nodejs script can't work well at msys2 shell
something worng make $basedir always become empty
than case this bug Error: Cannot find module 'C:\msys64\node_modules\gulp\bin\gulp.js'
how can i fix this?
msys2-bug-test
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
echo \$0 = $0
echo
echo \$\(dirname \"\$\(echo \"\$0\" \| sed -e \'s,\\,/,g\'\)\"\)
echo
echo \"$basedir\" should eq $(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
echo $(echo "$0" | sed -e 's,\\,/,g')
will output
$ msys2-bug-test
$0 = /c/Users/USER/AppData/Roaming/npm/msys2-bug-test
$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
"" should eq .
/c/Users/USER/AppData/Roaming/npm/msys2-bug-test