File: yarn

package info (click to toggle)
node-yarnpkg 4.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,752 kB
  • sloc: javascript: 38,953; ansic: 26,035; cpp: 7,247; sh: 2,829; makefile: 724; perl: 493
file content (36 lines) | stat: -rwxr-xr-x 1,067 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
argv0=$(echo "$0" | sed -e 's,\\,/,g')
basedir=$(dirname "$(readlink "$0" || echo "$argv0")")

case "$(uname -s)" in
  Darwin) basedir="$(cd "$( dirname "$argv0")" && pwd)";;
  Linux) basedir=$(dirname "$(readlink -f "$0" || echo "$argv0")");;
  *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
  *MSYS*) basedir=`cygpath -w "$basedir"`;;
  *MINGW*) basedir=`cygpath -w "$basedir"`;;
esac

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

if command_exists node; then
  if [ "$YARN_FORCE_WINPTY" = 1 ] || command_exists winpty && test -t 1; then
    winpty node "$basedir/yarn.js" "$@"
  else
    exec 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:
# 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
  exec nodejs "$basedir/yarn.js" "$@"
  ret=$?
else
  >&2 echo 'Yarn requires Node.js 4.0 or higher to be installed.'
  ret=1
fi

exit $ret