mirror of
https://github.com/warpdotdev/warp.git
synced 2026-06-14 04:46:24 +08:00
- 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.
44 lines
1.5 KiB
Bash
Executable File
44 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Install all dependencies required to build, run, and test Warp on Linux.
|
|
|
|
set -e
|
|
|
|
. "$PWD/script/warp_sudo"
|
|
|
|
# Define some control sequences for text formatting.
|
|
red="\033[0;31m"
|
|
reset="\033[0m"
|
|
|
|
# Install runtime dependencies.
|
|
"$PWD"/script/linux/install_runtime_deps
|
|
|
|
# Install additional testing dependencies.
|
|
UNAME="$(uname -a)"
|
|
if [[ "$(source /etc/os-release; echo $ID $ID_LIKE)" = *"debian"* ]]; then
|
|
echo "⬇️ Installing test dependencies..."
|
|
# Define the packages to install as a bash array so we can include
|
|
# comments between lines.
|
|
PACKAGES=(
|
|
# Install the zsh and fish shells.
|
|
zsh fish
|
|
# We run vim in some integration tests to test the altscreen.
|
|
vim
|
|
)
|
|
warp_sudo apt-get install -y "${PACKAGES[@]}"
|
|
|
|
# If gcloud is not already installed, install it so that we can run SSH integration tests.
|
|
if [[ ! -x "$(command -v gcloud)" ]]; then
|
|
echo "⬇️ Installing the gcloud CLI..."
|
|
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | warp_sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list
|
|
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | warp_sudo gpg --dearmor --yes -o /usr/share/keyrings/cloud.google.gpg
|
|
warp_sudo apt-get update -y
|
|
warp_sudo apt-get install google-cloud-cli -y
|
|
fi
|
|
else
|
|
echo -e "⚠️ ${red}Unknown Linux distribution; necessary test dependencies may not be installed!${reset}"
|
|
fi
|
|
|
|
# Install various testing dependencies through cargo.
|
|
"$PWD"/script/install_cargo_test_deps
|