default-packages
This file
Path
test/installation_node/default-packages
123 lines · 2.6 KiB
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 5c12680 point at it.
[Dev Deps] update `markdown-link-check`Jordan Harbandbefore adoption5c12680
lines 1–123why, one step back1#!/bin/sh23FILE="$NVM_DIR/default-packages"45die () { echo "$@" ; cleanup ; exit 1; }6setup () {7 if [ -f $FILE ]; then8 ORIG_DEFAULT_PACKAGES=$(cat $FILE)9 mkdir ./tmp/ ||:10 mv $FILE ./tmp/default-packages ||:11 fi12 touch $FILE13}14cleanup () {15 rm -rf "$(nvm_version_path v6.10.1)" $FILE16 if [ "$ORIG_DEFAULT_PACKAGES" != "" ]; then17 rm -rf ./tmp/18 echo "$ORIG_DEFAULT_PACKAGES" > $FILE19 fi20}2122setup2324\. ../../nvm.sh2526cat > $FILE << EOF27rimraf28object-inspect@1.0.22930# commented-package3132stevemao/left-pad33daytime34EOF3536printf %s "$(cat "${FILE}")" > $FILE # strip trailing newline3738nvm install v6.10.1 2>&139EXIT_CODE=$?40[ "_$EXIT_CODE" = "_0" ] || die "expected 'nvm install v6.10.1' to exit with 0, got $EXIT_CODE"4142nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'rimraf'43if [ -z "$?" ]; then44 die "expected 'nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'rimraf'' to exit with 0, got $?"45fi4647nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'daytime'48if [ -z "$?" ]; then49 die "expected 'nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'daytime'' to exit with 0, got $?"50fi5152cleanup5354setup5556\. ../../nvm.sh5758cat > $FILE << EOF59rimraf60object-inspect@1.0.26162# commented-package6364stevemao/left-pad65EOF6667nvm install v6.10.1 --skip-default-packages 2>&168EXIT_CODE=$?69[ "_$EXIT_CODE" = "_0" ] || die "expected 'nvm install v6.10.1' to exit with 0, got $EXIT_CODE"7071if nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'rimraf'; then72 die "expected 'nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'rimraf'' to be empty"73fi7475cleanup7677setup7879cat > $FILE << EOF80not~a~package~name81EOF8283nvm install v6.10.184EXIT_CODE=$?85[ "_$EXIT_CODE" = "_0" ] || die "expected 'nvm install v6.10.1' to exit with 0, got $EXIT_CODE"8687if nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'not~a~package~name'; then88 die "expected 'nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'not~a~package~name'' to exit with 1, got $?"89fi9091cleanup9293setup9495cat > $FILE << EOF96object-inspect @ 1.0.297EOF9899nvm install v6.10.1 2>&1100EXIT_CODE=$?101[ "_$EXIT_CODE" = "_1" ] || die "expected 'nvm install v6.10.1' to exit with 1, got $EXIT_CODE"102103if nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'object-inspect'; then104 die "expected 'nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'object-inspect'' to exit with 1, got $?"105fi106107cleanup108109setup110111rm -rf $FILE112113nvm install v6.10.1 2>&1114EXIT_CODE=$?115[ "_$EXIT_CODE" = "_0" ] || die "expected 'nvm install v6.10.1' to exit with 0, got $EXIT_CODE"116117if nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'object-inspect'; then118 die "expected 'nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'object-inspect'' to exit with 1, got $?"119fi120121touch $FILE122123cleanup