zed/script/install-linux
Chinmay Dalal 1260b52c82
linux scripts: Respect $CARGO_TARGET_DIR (#13830)
https://doc.rust-lang.org/cargo/reference/environment-variables.html

Some people (myself included) set this variable to have a single
directory to clean up (or whatever reason one might have for having a
single `target` directory). This changes the linux scripts to respect
that

Release Notes:

- N/A
2024-07-05 14:19:05 +03:00

27 lines
747 B
Bash
Executable File

#!/usr/bin/env bash
set -euxo pipefail
if [[ $# -gt 0 ]]; then
echo "
Usage: ${0##*/}
Builds and installs zed onto your system into ~/.local, making it available as ~/.local/bin/zed.
Before running this you should ensure you have all the build dependencies installed with `./script/linux`.
"
exit 1
fi
export ZED_CHANNEL=$(<crates/zed/RELEASE_CHANNEL)
export ZED_UPDATE_EXPLANATION="You need to fetch and rebuild zed in $(pwd)"
script/bundle-linux
target="linux-$(uname -m)"
commit=$(git rev-parse HEAD | cut -c 1-7)
if [[ "$ZED_CHANNEL" == "dev" ]]; then
archive="zed-${commit}-${target}.tar.gz"
else
archive="zed-${target}.tar.gz"
fi
export ZED_BUNDLE_PATH="${CARGO_TARGET_DIR:-target}/release/${archive}"
script/install.sh