2014-08-01 10:46:08 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
die () { echo "$@" ; exit 1; }
|
|
|
|
|
|
|
|
. ../../../nvm.sh
|
|
|
|
|
|
|
|
nvm use 0.10.28
|
|
|
|
|
2014-08-22 17:19:56 +08:00
|
|
|
EXPECTED_PACKAGES="autoprefixer bower david eslint grunt-cli grunth-cli http-server jshint marked node-gyp recursive-blame uglify-js yo"
|
2014-08-01 10:46:08 +08:00
|
|
|
|
2014-08-22 17:44:04 +08:00
|
|
|
echo "$EXPECTED_PACKAGES" | xargs npm install -g --quiet
|
2014-08-01 10:46:08 +08:00
|
|
|
|
|
|
|
nvm use 0.10.29
|
2014-09-03 06:04:35 +08:00
|
|
|
ORIGINAL_PACKAGES=$(npm list -g --depth=0 | tail -n +2 | \grep -o -e ' [^@]*' | cut -c 2- | \grep -v npm | sort | uniq | xargs)
|
2014-08-01 10:46:08 +08:00
|
|
|
|
|
|
|
nvm copy-packages 0.10.28
|
2014-09-03 06:04:35 +08:00
|
|
|
FINAL_PACKAGES=$(npm list -g --depth=0 | tail -n +2 | \grep -o -e ' [^@]*' | cut -c 2- | \grep -v npm | sort | uniq | xargs)
|
2014-08-01 10:46:08 +08:00
|
|
|
|
|
|
|
[ "$FINAL_PACKAGES" = "$EXPECTED_PACKAGES" ] || die "final packages ($FINAL_PACKAGES) did not match expected packages ($EXPECTED_PACKAGES)"
|
|
|
|
[ "$ORIGINAL_PACKAGES" != "$FINAL_PACKAGES" ] || die "original packages matched final packages ($ORIGINAL_PACKAGES)"
|
|
|
|
|