continue-custom/scripts/install-dependencies.sh
Josh Holmer ed7dc465bf
Fix install-all-dependencies script
Because the script was missing the step to build `openai-adapters`,
the build would fail, leading to the inability to run tests or the local
copy of the extension.
2025-07-02 23:05:16 -04:00

79 lines
2 KiB
Bash
Executable file

#!/usr/bin/env bash
# This is used in a task in .vscode/tasks.json
# Start developing with:
# - Run Task -> Install Dependencies
# - Debug -> Extension
set -e
# Check if node version matches .nvmrc
if [ -f .nvmrc ]; then
required_node_version=$(cat .nvmrc)
current_node_version=$(node -v)
# Remove 'v' prefix from versions for comparison
required_version=${required_node_version#v}
current_version=${current_node_version#v}
if [ "$required_version" != "$current_version" ]; then
echo "⚠️ Warning: Your Node.js version ($current_node_version) does not match the required version ($required_node_version)"
echo "Please consider switching to the correct version using: nvm use"
if [ -t 0 ]; then
read -p "Press Enter to continue with installation anyway..."
else
echo "Continuing with installation anyway..."
fi
echo
fi
fi
echo "Installing root-level dependencies..."
npm install
echo "Building openai-adapters..."
pushd packages/openai-adapters
npm install
npm run build
popd
echo "Building config-yaml..."
pushd packages/config-yaml
npm install
npm run build
popd
echo "Installing Core extension dependencies..."
pushd core
## This flag is set because we pull down Chromium at runtime
export PUPPETEER_SKIP_DOWNLOAD='true'
npm install
npm link
popd
echo "Installing GUI extension dependencies..."
pushd gui
npm install
npm link @continuedev/core
npm run build
popd
# VSCode Extension (will also package GUI)
echo "Installing VSCode extension dependencies..."
pushd extensions/vscode
# This does way too many things inline but is the common denominator between many of the scripts
npm install
npm link @continuedev/core
# npm run prepackage # not required since npm run package has prescript of prepackage
npm run package
popd
echo "Installing binary dependencies..."
pushd binary
npm install
npm run build
popd
echo "Installing docs dependencies..."
pushd docs
npm install
popd