Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make yarn interactive commands run in Git Bash/MSYS environment #2230

Merged
merged 1 commit into from
Dec 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion bin/yarn
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
#!/bin/sh
basedir=$(dirname "$(readlink "$0" || echo "$(echo "$0" | sed -e 's,\\,/,g')")")

is_msys=0

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

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

if command_exists node; then
node "$basedir/yarn.js" "$@"
if [ $is_msys -eq 1 ]; then
winpty node "$basedir/yarn.js" "$@"
else
node "$basedir/yarn.js" "$@"
fi
ret=$?
# Debian and Ubuntu use "nodejs" as the name of the binary, not "node", so we
# search for that too. See:
Expand Down