Skip to content

Commit

Permalink
Support interactive commands in standard MINGW as well (#2243)
Browse files Browse the repository at this point in the history
* Support interactive commands in standard MINGW as well

Previous fix only supported some old configuration of Git bash
provided by Git for windows, newer Git bash use standard MINGW
which uses a different `uname` but the fix is ultimately the same

Github: #743

* Refactor: use better variable name when determine to use winpty

* Support both MSYS 32bit and 64bit terminal emulators
  • Loading branch information
thetrompf authored and Daniel15 committed Dec 15, 2016
1 parent 6a317c2 commit 35ca860
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/yarn
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/sh
basedir=$(dirname "$(readlink "$0" || echo "$(echo "$0" | sed -e 's,\\,/,g')")")

is_msys=0
use_winpty=0

case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
*MSYS_NT*) is_msys=1;;
MSYS*|MINGW*) use_winpty=1;;
esac

command_exists() {
command -v "$1" >/dev/null 2>&1;
}

if command_exists node; then
if [ $is_msys -eq 1 ]; then
if [ $use_winpty -eq 1 ]; then
winpty node "$basedir/yarn.js" "$@"
else
node "$basedir/yarn.js" "$@"
Expand Down

0 comments on commit 35ca860

Please sign in to comment.