linux make install (#12870)

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-06-10 20:43:13 -06:00 committed by GitHub
parent 44a58647e4
commit ef84ce76e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 60 additions and 25 deletions

View file

@ -95,14 +95,12 @@ mkdir -p "${zed_dir}/share/applications"
envsubst < "crates/zed/resources/zed.desktop.in" > "${zed_dir}/share/applications/zed$suffix.desktop"
# Licenses
script/generate-licenses
cp "assets/licenses.md" "${zed_dir}/licenses.md"
# Create archive out of everything that's in the temp directory
target="linux-$(uname -m)"
if [[ "$channel" == "nightly" ]]; then
archive="zed-${target}.tar.gz"
elif [[ "$channel" == "dev" ]]; then
if [[ "$channel" == "dev" ]]; then
archive="zed-${commit}-${target}.tar.gz"
else
archive="zed-${target}.tar.gz"

26
script/install-linux Executable file
View file

@ -0,0 +1,26 @@
#!/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="target/release/${archive}"
script/install.sh

View file

@ -43,8 +43,12 @@ main() {
}
linux() {
echo "Downloading Zed"
curl "https://zed.dev/api/releases/$channel/latest/zed-linux-$arch.tar.gz" > "$temp/zed-linux-$arch.tar.gz"
if [[ -n "${ZED_BUNDLE_PATH:-}" ]]; then
cp "$ZED_BUNDLE_PATH" "$temp/zed-linux-$arch.tar.gz"
else
echo "Downloading Zed"
curl "https://zed.dev/api/releases/$channel/latest/zed-linux-$arch.tar.gz" > "$temp/zed-linux-$arch.tar.gz"
fi
suffix=""
if [[ $channel != "stable" ]]; then
@ -91,7 +95,7 @@ linux() {
desktop_file_path="$HOME/.local/share/applications/${appid}.desktop"
cp ~/.local/zed$suffix.app/share/applications/zed$suffix.desktop "${desktop_file_path}"
sed -i "s|Icon=zed|Icon=$HOME/.local/zed$suffix.app/share/icons/hicolor/512x512/apps/zed.png|g" "${desktop_file_path}"
sed -i "s|Exec=zed|Exec=$HOME/.local/zed$suffix.app/bin/zed|g" "${desktop_file_path}"
sed -i "s|Exec=zed|Exec=$HOME/.local/zed$suffix.app/libexec/zed-editor|g" "${desktop_file_path}"
if which "zed" >/dev/null 2>&1; then
echo "Zed has been installed. Run with 'zed'"