forked from yarnpkg/yarn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert "yarn" executable to a shell script that runs either "node" o…
…r "nodejs" Also fixes Cygwin. Closes yarnpkg#1142 Closes yarnpkg#819
- Loading branch information
Showing
3 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
#!/usr/bin/env node | ||
require('./yarn.js'); | ||
#!/bin/sh | ||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | ||
|
||
case `uname` in | ||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | ||
esac | ||
|
||
command_exists() { | ||
command -v "$1" >/dev/null 2>&1; | ||
} | ||
|
||
if command_exists node; then | ||
node "$basedir/yarn.js" "$@" | ||
ret=$? | ||
# Debian and Ubuntu use "nodejs" as the name of the binary, not "node", so we | ||
# search for that too. See: | ||
# https://lists.debian.org/debian-devel-announce/2012/07/msg00002.html | ||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907 | ||
elif command_exists nodejs; then | ||
nodejs "$basedir/yarn.js" "$@" | ||
ret=$? | ||
else | ||
echo 'Yarn requires Node.js 4.0 or higher to be installed.' | ||
ret=1 | ||
fi | ||
|
||
exit $ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters