From 26fcb036625524bd52abd9d867095caf72da7961 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Mon, 16 May 2016 13:01:10 -0700 Subject: [PATCH] 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 6eb1a23ae9a..4505149dad4 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 2b03c2a057f..9336513de90 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" "$@"