From 45809778d2b5d93c6da56e908f216f509d561b29 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Sat, 6 Aug 2016 10:34:32 -0700 Subject: [PATCH] chore(install): fix install scripts & improve local usage Fix a few minor problems with Travis install & build scripts. Other changes allow `before-install.sh` to be run locally. --- scripts/before-install.sh | 8 +++----- scripts/env-info-and-check.sh | 4 +++- scripts/env-set.sh | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/before-install.sh b/scripts/before-install.sh index b99455e910..84b7ff8035 100755 --- a/scripts/before-install.sh +++ b/scripts/before-install.sh @@ -2,13 +2,11 @@ set -e -o pipefail -./scripts/env-info-and-check.sh +[[ -z "$NGIO_ENV_DEFS" ]] && . ./scripts/env-set.sh +[[ -n "$TRAVIS" ]] && . ./scripts/env-info-and-check.sh -if [[ 0 ]]; then - # Doesn't seem to be necessary. Disabling. - travis_fold start install.globals +if [ -z "$TRAVIS" ]; then set -x npm install -g gulp --no-optional set +x - travis_fold end install.globals fi diff --git a/scripts/env-info-and-check.sh b/scripts/env-info-and-check.sh index c919602f10..3442dc80e1 100755 --- a/scripts/env-info-and-check.sh +++ b/scripts/env-info-and-check.sh @@ -2,6 +2,8 @@ set -e -o pipefail +[[ -z "$NGIO_ENV_DEFS" ]] && . ./scripts/env-set.sh + travis_fold start env_info echo ENVIRONMENT INFO travis_fold start env_info.path @@ -11,7 +13,7 @@ echo travis_fold end env_info.path travis_fold start env_info.home echo Home: $HOME -ls ~ -la +ls -la ~ echo travis_fold end env_info.home travis_fold start env_info.pwd diff --git a/scripts/env-set.sh b/scripts/env-set.sh index 8341107a8c..89a3e5392e 100644 --- a/scripts/env-set.sh +++ b/scripts/env-set.sh @@ -3,7 +3,7 @@ if [[ -z "$NGIO_ENV_DEFS" ]]; then export ANSI_YELLOW="\033[33;1m" export ANSI_RESET="\033[0m" - echo -e "${ANSI_YELLOW}Setting environment variables from scripts/env.sh${ANSI_RESET}" + echo -e "${ANSI_YELLOW}Setting environment variables from scripts/env-set.sh${ANSI_RESET} " export NGIO_ENV_DEFS=1 @@ -12,7 +12,7 @@ if [[ -z "$NGIO_ENV_DEFS" ]]; then if [ ! $(type -t travis_fold) ]; then # In case this is being run locally. Turn travis_fold into a noop. - travis_fold () { return; } + travis_fold () { true; } # Alternative definition: # travis_fold () { echo -en "travis_fold:${1}:${2}"; } fi