diff --git a/.gitattributes b/.gitattributes index 6eb1a23ae..4505149da 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/resources/win/atom.sh b/resources/win/atom.sh index 99dd90bea..9336513de 100644 --- a/resources/win/atom.sh +++ b/resources/win/atom.sh @@ -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" "$@"