2020-12-18 05:16:04 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
main() {
|
|
|
|
cd "$(dirname "$0")/../.."
|
2022-01-05 05:02:25 +08:00
|
|
|
source ./ci/lib.sh
|
2020-12-18 05:16:04 +08:00
|
|
|
|
2022-01-05 05:02:25 +08:00
|
|
|
pushd test
|
|
|
|
echo "Installing dependencies for $PWD"
|
|
|
|
yarn install
|
|
|
|
popd
|
2021-09-09 03:05:49 +08:00
|
|
|
|
2021-11-05 00:39:27 +08:00
|
|
|
local args=(install)
|
|
|
|
if [[ ${CI-} ]]; then
|
|
|
|
args+=(--frozen-lockfile)
|
|
|
|
fi
|
|
|
|
|
2022-01-05 05:02:25 +08:00
|
|
|
pushd test
|
|
|
|
echo "Installing dependencies for $PWD"
|
2021-11-05 00:39:27 +08:00
|
|
|
yarn "${args[@]}"
|
2022-01-05 05:02:25 +08:00
|
|
|
popd
|
2021-01-22 07:39:04 +08:00
|
|
|
|
2022-01-05 05:02:25 +08:00
|
|
|
pushd test/e2e/extensions/test-extension
|
|
|
|
echo "Installing dependencies for $PWD"
|
|
|
|
yarn "${args[@]}"
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd vendor
|
|
|
|
echo "Installing dependencies for $PWD"
|
2021-09-09 03:05:49 +08:00
|
|
|
|
2021-11-05 00:39:27 +08:00
|
|
|
# We install in 'modules' instead of 'node_modules' because VS Code's
|
|
|
|
# extensions use a webpack config which cannot differentiate between its own
|
|
|
|
# node_modules and itself being in a directory with the same name.
|
|
|
|
args+=(--modules-folder modules)
|
2021-09-17 05:52:51 +08:00
|
|
|
|
2021-11-05 00:39:27 +08:00
|
|
|
# We ignore scripts because NPM/Yarn's default behavior is to assume that
|
|
|
|
# devDependencies are not needed, and that even git repo based packages are
|
|
|
|
# assumed to be compiled. Because the default behavior for VS Code's
|
|
|
|
# `postinstall` assumes we're also compiled, this needs to be ignored.
|
|
|
|
args+=(--ignore-scripts)
|
2021-09-17 05:52:51 +08:00
|
|
|
|
|
|
|
yarn "${args[@]}"
|
2020-12-18 05:16:04 +08:00
|
|
|
|
2021-09-09 03:05:49 +08:00
|
|
|
# Finally, run the vendor `postinstall`
|
|
|
|
yarn run postinstall
|
2022-01-05 05:02:25 +08:00
|
|
|
|
|
|
|
popd
|
2020-12-18 05:16:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|