Merge pull request #11833 from atom/dg-bash-on-windows

Ensure Cygwin + Msys compatibility on Windows
This commit is contained in:
Damien Guard
2016-05-29 17:22:10 -07:00

View File

@@ -1,9 +1,16 @@
#!/bin/sh
#!/bin/bash
# Get current path in Windows format
if command -v "cygpath" > /dev/null; then
ATOMCMD=""$(cygpath "$(dirname "$0")" -a -w)\\atom.cmd""
# We have cygpath to do the conversion
ATOMCMD=$(cygpath "$(dirname "$0")/atom.cmd" -a -w)
else
# We don't have cygpath so try pwd -W
pushd "$(dirname "$0")" > /dev/null
ATOMCMD=""$(pwd -W)/atom.cmd""
ATOMCMD="$(pwd -W)/atom.cmd"
popd > /dev/null
fi
cmd.exe /C "$ATOMCMD" "$@"
if [ "$(uname -o)" == "Msys" ]; then
cmd.exe //C "$ATOMCMD" "$@" # Msys thinks /C is a Windows path...
else
cmd.exe /C "$ATOMCMD" "$@" # Cygwin does not
fi