mirror of
https://github.com/warpdotdev/warp.git
synced 2026-05-09 17:00:54 +08:00
29 lines
967 B
Bash
Executable File
29 lines
967 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Installs the warp_channel_config binary at a pinned revision.
|
|
#
|
|
# This script acts as a lockfile: the REVISION variable pins the exact version
|
|
# of the config binary to the code that reads its output. Update REVISION when
|
|
# the config binary changes.
|
|
#
|
|
# Usage:
|
|
# ./script/install_channel_config # install if not already at pinned rev
|
|
# ./script/install_channel_config --force # force reinstall
|
|
|
|
REPO="ssh://git@github.com/warpdotdev/warp-channel-config.git"
|
|
REVISION="97a199b5bba11af9c7d3bd43dfb3669316d1f0f8"
|
|
BIN_NAME="warp-channel-config"
|
|
|
|
# Check for repo access before attempting to `cargo install` the binary.
|
|
if ! git ls-remote --exit-code "${REPO}" HEAD >/dev/null 2>&1; then
|
|
echo "Cannot access ${REPO} (no SSH access?). Skipping install."
|
|
exit 1
|
|
fi
|
|
|
|
FORCE_FLAG=""
|
|
if [ "${1:-}" = "--force" ]; then
|
|
FORCE_FLAG="--force"
|
|
fi
|
|
|
|
cargo install ${FORCE_FLAG} --git "${REPO}" --rev "${REVISION}" --bin "${BIN_NAME}"
|