From 0e5a4ffb6e34687eb8bd208e170564f5ffa4419c Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Sun, 15 May 2016 21:02:47 -0700 Subject: [PATCH 1/2] Ensure atom command works on Cygwin + MSYS bash shells --- resources/win/atom.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/win/atom.sh b/resources/win/atom.sh index 99dd90bea..2b03c2a05 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" +if command -v "cygpath" > /dev/null; then + ATOMCMD=""$(cygpath . -a -w)atom.cmd"" +else + ATOMCMD=""$(pwd -W)/atom.cmd"" +fi popd > /dev/null cmd.exe //c "$ATOMCMD" "$@" From 26fcb036625524bd52abd9d867095caf72da7961 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Mon, 16 May 2016 13:01:10 -0700 Subject: [PATCH 2/2] Optimize bash Windows, force LF line endings --- .gitattributes | 3 +++ resources/win/atom.sh | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) 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 2b03c2a05..9336513de 100644 --- a/resources/win/atom.sh +++ b/resources/win/atom.sh @@ -1,9 +1,9 @@ #!/bin/sh -pushd "$(dirname "$0")" > /dev/null if command -v "cygpath" > /dev/null; then - ATOMCMD=""$(cygpath . -a -w)atom.cmd"" + ATOMCMD=""$(cygpath "$(dirname "$0")" -a -w)\\atom.cmd"" else + pushd "$(dirname "$0")" > /dev/null ATOMCMD=""$(pwd -W)/atom.cmd"" + popd > /dev/null fi -popd > /dev/null -cmd.exe //c "$ATOMCMD" "$@" +cmd.exe /C "$ATOMCMD" "$@"