Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
920 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
set -euo pipefail
2022-03-14 21:37:29 -05:00
# Install dependencies in $1.
install-deps() {
2024-10-18 06:31:28 +02:00
local args=()
2022-03-14 21:37:29 -05:00
if [[ ${CI-} ]]; then
2024-10-18 06:31:28 +02:00
args+=(ci)
else
args+=(install)
2022-03-14 21:37:29 -05:00
fi
2024-10-18 06:31:28 +02:00
# If there is no package.json then npm will look upward and end up installing
2022-03-14 21:37:29 -05:00
# 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"
echo "Installing dependencies for $PWD"
2024-10-18 06:31:28 +02:00
npm "${args[@]}"
2022-03-14 21:37:29 -05:00
popd
}
main() {
cd "$(dirname "$0")/../.."
source ./ci/lib.sh
2022-03-14 21:37:29 -05:00
install-deps test
install-deps test/e2e/extensions/test-extension
# We don't need these when running the integration tests
# so you can pass SKIP_SUBMODULE_DEPS
if [[ ! ${SKIP_SUBMODULE_DEPS-} ]]; then
install-deps lib/vscode
fi
}
main "$@"