1
0
Fork 0
spacetac/spacetac

20 lines
695 B
Plaintext
Raw Normal View History

2017-01-10 18:08:36 +00:00
#!/bin/bash
# Main build/run tool
2017-10-15 17:54:37 +00:00
# REQUIRES yarn
# If yarn is not found, python3 may be used to create a local node.js environment with yarn in it, and use it
2017-01-10 18:08:36 +00:00
2017-10-15 17:54:37 +00:00
yarn=$(which yarn 2>/dev/null)
2017-01-10 18:08:36 +00:00
set -e
2017-10-15 17:54:37 +00:00
if [ "x${yarn}" != "x" ]
then
"${yarn}" "$@"
else
dir=$(dirname $0)
2017-01-10 18:08:36 +00:00
2017-10-15 17:54:37 +00:00
test -x "${dir}/.env/bin/nodeenv" || ( virtualenv -p python3 "${dir}/.env" && "${dir}/.env/bin/pip" install --upgrade nodeenv )
test -e "${dir}/.env/node/bin/activate" || "${dir}/.env/bin/nodeenv" --node=9.3.0 --force "${dir}/.env/node"
test -e "${dir}/.env/node/bin/yarn" || "${dir}/.env/node/bin/shim" "${dir}/.env/node/bin/npm" install -g yarn@1.3.2
2017-10-15 17:54:37 +00:00
PATH="${dir}/.env/node/bin:${PATH}" yarn "$@"
fi