UNPKG

1.03 kBapplication/x-shView Raw
1#!/usr/bin/env bash
2
3
4YARN=$(which yarn)
5SUMAN_DEBUG_LOG_PATH=$HOME/.suman/suman-debug.log
6
7if [[ -z "${YARN}" ]]; then
8# npm install -g yarn &&
9 if [[ ! -z "${SUMAN_DEBUG}" ]]; then
10 echo "need SUDO to install yarn installed successfully" >> ${SUMAN_DEBUG_LOG_PATH};
11 fi
12else
13 if [[ ! -z "${SUMAN_DEBUG}" ]]; then
14 echo "yarn already installed here => $YARN" >> ${SUMAN_DEBUG_LOG_PATH};
15 fi
16fi
17
18
19# note: if BASE_DIRECTORY is not /home or /users, we are global
20SUMAN_BASE_DIRECTORY=$(echo "$PWD" | cut -d "/" -f2)
21
22if [[ ! -z "${SUMAN_DEBUG}" ]]; then
23 echo "BASE_DIRECTORY of PWD => $SUMAN_BASE_DIRECTORY" ;
24fi
25
26# create a package.json skeleton just to keep NPM from complaining
27# we can also keep track of which deps are actually installed, and their versions
28# we execute in a subshell so we don't actually change the current directory
29(cd $HOME/.suman/global && npm init -f >> ${SUMAN_DEBUG_LOG_PATH} 2>&1) &
30
31wait;
32
33node $(dirname "$0")/install-optional-deps.js >> ${SUMAN_DEBUG_LOG_PATH} 2>&1
34