2016-04-20 13:49:49 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-07-03 09:37:53 +08:00
|
|
|
set -ex
|
2016-04-20 13:49:49 +08:00
|
|
|
|
|
|
|
echo 'Updating test mocks...'
|
|
|
|
|
|
|
|
MOCKS_DIR="$PWD/test/fast/Unit tests/mocks"
|
|
|
|
|
|
|
|
echo "creating $MOCKS_DIR"
|
2016-06-26 08:03:46 +08:00
|
|
|
mkdir -p "$MOCKS_DIR"
|
2016-04-20 13:49:49 +08:00
|
|
|
|
2016-06-26 08:03:46 +08:00
|
|
|
. "$NVM_DIR/nvm.sh" --no-use
|
2016-06-26 08:00:19 +08:00
|
|
|
nvm deactivate 2> /dev/null
|
|
|
|
nvm_is_version_installed() {
|
|
|
|
return 1
|
|
|
|
}
|
2016-04-20 13:49:49 +08:00
|
|
|
|
2016-07-03 12:21:16 +08:00
|
|
|
nvm_make_alias() {
|
|
|
|
# prevent local alias creation
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2016-04-27 16:25:56 +08:00
|
|
|
nvm_ls_remote > "$MOCKS_DIR/nvm_ls_remote.txt"
|
|
|
|
nvm_ls_remote_iojs > "$MOCKS_DIR/nvm_ls_remote_iojs.txt"
|
2016-04-24 14:47:25 +08:00
|
|
|
NVM_LTS=* nvm_ls_remote > "$MOCKS_DIR/nvm_ls_remote LTS.txt"
|
|
|
|
NVM_LTS=argon nvm_ls_remote > "$MOCKS_DIR/nvm_ls_remote LTS argon.txt"
|
2016-04-20 13:49:49 +08:00
|
|
|
nvm_download -L -s "$NVM_NODEJS_ORG_MIRROR/index.tab" -o - > "$MOCKS_DIR/nodejs.org-dist-index.tab"
|
|
|
|
nvm_download -L -s "$NVM_IOJS_ORG_MIRROR/index.tab" -o - > "$MOCKS_DIR/iojs.org-dist-index.tab"
|
2016-06-26 08:00:19 +08:00
|
|
|
nvm ls-remote > "$MOCKS_DIR/nvm ls-remote.txt"
|
|
|
|
nvm ls-remote --lts > "$MOCKS_DIR/nvm ls-remote lts.txt"
|
|
|
|
nvm ls-remote node > "$MOCKS_DIR/nvm ls-remote node.txt"
|
|
|
|
nvm ls-remote iojs > "$MOCKS_DIR/nvm ls-remote iojs.txt"
|
2016-04-20 13:49:49 +08:00
|
|
|
|
2016-07-03 12:21:16 +08:00
|
|
|
ALIAS_PATH="$MOCKS_DIR/nvm_make_alias LTS alias calls.txt"
|
|
|
|
: > "$ALIAS_PATH"
|
|
|
|
nvm_make_alias() {
|
|
|
|
# prevent local alias creation, and store arguments
|
|
|
|
echo "${1}|${2}" >> "$ALIAS_PATH"
|
|
|
|
}
|
|
|
|
nvm ls-remote --lts
|
|
|
|
|
2016-04-20 13:49:49 +08:00
|
|
|
echo "done! Don't forget to git commit them."
|