forked from openai/openai-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap-node
More file actions
executable file
·29 lines (25 loc) · 1.08 KB
/
Copy pathbootstrap-node
File metadata and controls
executable file
·29 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
if ! command -v node >/dev/null 2>&1; then
echo 'Node.js is required. Install the version in .node-version, then rerun ./scripts/bootstrap.' >&2
exit 1
fi
node scripts/utils/node-tooling.cjs --check-node
PNPM_VERSION="$(node -p 'require("./package.json").packageManager.slice("pnpm@".length)')"
# Even a Corepack shim or an older pnpm must not download another manager.
export COREPACK_ENABLE_NETWORK=0
export npm_config_manage_package_manager_versions=false
export pnpm_config_pm_on_fail=error
export pnpm_config_runtime_on_fail=error
if ! command -v pnpm >/dev/null 2>&1 || ! ACTUAL_PNPM_VERSION="$(pnpm --version)"; then
echo "Install pnpm explicitly with: npm install --global pnpm@${PNPM_VERSION}" >&2
exit 1
fi
if [ "$ACTUAL_PNPM_VERSION" != "$PNPM_VERSION" ]; then
echo "Expected pnpm ${PNPM_VERSION}, found ${ACTUAL_PNPM_VERSION}." >&2
echo "Install it explicitly with: npm install --global pnpm@${PNPM_VERSION}" >&2
exit 1
fi
echo '==> Installing locked Node tooling…'
pnpm install --frozen-lockfile --ignore-scripts