Files
warp/script/macos/bootstrap
Tautik Agrahari ce89a98b53 fix(bootstrap): warn before sudo and document install steps (#9501)
- new `script/warp_sudo`: echoes each privileged command, prompts
`[y/N]` from `/dev/tty`, shells to real `sudo` on confirm.
`WARP_BOOTSTRAP_YES=1` or non-tty stdin skips.
- `script/bootstrap`: static `--help` install list dropped. `-y`/`--yes`
exports `WARP_BOOTSTRAP_YES=1` for children.
- ten direct `sudo` call-sites in `script/{macos,linux}/bootstrap` +
`script/linux/install_{build,runtime,test}_deps` switched to
`warp_sudo`. windows unchanged.
- `README.md`: short "what `./script/bootstrap` does" subsection
pointing at the platform scripts as the source of truth.

closes #9421.
2026-05-04 16:36:47 -04:00

72 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
#
# Run this script once to prepare your machine to develop Warp. This script is
# a work in progress, and may be incomplete.
set -e
. "$PWD/script/warp_sudo"
if ! [ -d "/Applications/Xcode.app" ]; then
echo "Please install Xcode from the App Store before continuing."
exit 1
fi
warp_sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
# Mimic actually launching XCode, which performs some necessary set-up of the
# development environment.
xcodebuild -runFirstLaunch
if ! command -v brew; then
echo "Installing brew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "Please make sure brew is set correctly in your PATH"
exit 1
fi
if ! command -v cargo; then
echo "Installing rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
echo "Please start a new terminal session so that cargo is in your PATH"
exit 1
fi
# Install various binaries through cargo.
"$PWD"/script/install_cargo_test_deps
"$PWD"/script/install_cargo_release_deps
# Install a version of cargo-bundle that supports the --profile flag
cargo install cargo-bundle --git=https://github.com/burtonageo/cargo-bundle --rev ae4c76e92c08774bf54ff077b1c52e3d1cd6c16d
# Update brew
brew update
brew install jq
brew install getsentry/tools/sentry-cli
brew install clang-format
brew install create-dmg
brew install multitime
brew install powershell
brew install pkgconf
brew install llvm
# Install PSScriptAnalyzer for PowerShell linting
pwsh -Command "Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser"
if ! [ "$(command -v docker)" ]; then
brew install --cask docker
fi
if ! [ "$(command -v gcloud)" ]; then
brew install google-cloud-sdk
fi
if [[ -z $(gcloud auth print-identity-token) ]]; then
echo "gcloud CLI authentication missing. Press enter to continue..."
read var
gcloud auth login
fi
# Needed for building for Mac ARM machines (e.g. M1)
rustup target add aarch64-apple-darwin