Merge pull request #11762 from atom/dg-winbash-msys-cygwin-compatibility

Ensure atom command works on Cygwin + MSYS bash shells
This commit is contained in:
Damien Guard
2016-05-18 10:21:47 -07:00
2 changed files with 11 additions and 4 deletions

3
.gitattributes vendored
View File

@@ -12,3 +12,6 @@ spec/fixtures/css.css text eol=lf
spec/fixtures/sample.js text eol=lf
spec/fixtures/sample.less text eol=lf
spec/fixtures/sample.txt text eol=lf
# Windows bash scripts are also Unix LF endings
*.sh eol=lf

View File

@@ -1,5 +1,9 @@
#!/bin/sh
pushd "$(dirname "$0")" > /dev/null
ATOMCMD=""$(pwd -W)"/atom.cmd"
popd > /dev/null
cmd.exe //c "$ATOMCMD" "$@"
if command -v "cygpath" > /dev/null; then
ATOMCMD=""$(cygpath "$(dirname "$0")" -a -w)\\atom.cmd""
else
pushd "$(dirname "$0")" > /dev/null
ATOMCMD=""$(pwd -W)/atom.cmd""
popd > /dev/null
fi
cmd.exe /C "$ATOMCMD" "$@"