2020-12-17 22:16:04 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2022-03-15 03:37:29 +01:00
|
|
|
# Install dependencies in $1.
|
|
|
|
install-deps() {
|
2021-11-04 17:39:27 +01:00
|
|
|
local args=(install)
|
|
|
|
if [[ ${CI-} ]]; then
|
|
|
|
args+=(--frozen-lockfile)
|
|
|
|
fi
|
2022-03-15 03:37:29 +01:00
|
|
|
# If there is no package.json then yarn will look upward and end up installing
|
|
|
|
# from the root resulting in an infinite loop (this can happen if you have not
|
|
|
|
# checked out the submodule yet for example).
|
|
|
|
if [[ ! -f "$1/package.json" ]]; then
|
|
|
|
echo "$1/package.json is missing; did you run git submodule update --init?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
pushd "$1"
|
2022-01-04 22:02:25 +01:00
|
|
|
echo "Installing dependencies for $PWD"
|
|
|
|
yarn "${args[@]}"
|
|
|
|
popd
|
2022-03-15 03:37:29 +01:00
|
|
|
}
|
2022-01-04 22:02:25 +01:00
|
|
|
|
2022-03-15 03:37:29 +01:00
|
|
|
main() {
|
|
|
|
cd "$(dirname "$0")/../.."
|
|
|
|
source ./ci/lib.sh
|
2022-01-04 22:02:25 +01:00
|
|
|
|
2022-03-15 03:37:29 +01:00
|
|
|
install-deps test
|
|
|
|
install-deps test/e2e/extensions/test-extension
|
|
|
|
install-deps lib/vscode
|
2020-12-17 22:16:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|