linux preview… (#11286)
Release Notes: - (preview only) You can now install an (alpha) preview build on linux
This commit is contained in:
parent
b487f2ce6f
commit
d8ca15372c
2 changed files with 14 additions and 11 deletions
|
@ -52,7 +52,7 @@ zed_dir="${temp_dir}/zed$suffix.app"
|
||||||
|
|
||||||
# Binary
|
# Binary
|
||||||
mkdir -p "${zed_dir}/bin"
|
mkdir -p "${zed_dir}/bin"
|
||||||
cp "target/${target_triple}/release/Zed" "${zed_dir}/zed"
|
cp "target/${target_triple}/release/Zed" "${zed_dir}/bin/zed"
|
||||||
|
|
||||||
# Icons
|
# Icons
|
||||||
mkdir -p "${zed_dir}/share/icons/hicolor/512x512/apps"
|
mkdir -p "${zed_dir}/share/icons/hicolor/512x512/apps"
|
||||||
|
@ -62,7 +62,7 @@ cp "crates/zed/resources/app-icon$suffix@2x.png" "${zed_dir}/share/icons/hicolor
|
||||||
|
|
||||||
# .desktop
|
# .desktop
|
||||||
mkdir -p "${zed_dir}/share/applications"
|
mkdir -p "${zed_dir}/share/applications"
|
||||||
cp "crates/zed/resources/zed$suffix.desktop" "${zed_dir}/share/applications/zed$suffix.desktop"
|
cp "crates/zed/resources/zed.desktop" "${zed_dir}/share/applications/zed$suffix.desktop"
|
||||||
if [[ "$channel" == "preview" ]]; then
|
if [[ "$channel" == "preview" ]]; then
|
||||||
sed -i "s|Name=Zed|Name=Zed Preview|g" "${zed_dir}/share/applications/zed$suffix.desktop"
|
sed -i "s|Name=Zed|Name=Zed Preview|g" "${zed_dir}/share/applications/zed$suffix.desktop"
|
||||||
elif [[ "$channel" == "nightly" ]]; then
|
elif [[ "$channel" == "nightly" ]]; then
|
||||||
|
@ -84,4 +84,4 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf "${archive}"
|
rm -rf "${archive}"
|
||||||
tar -czvf $archive -C ${temp_dir} ${zed_dir}
|
tar -czvf $archive -C ${temp_dir} "zed$suffix.app"
|
||||||
|
|
|
@ -4,14 +4,14 @@ set -euo pipefail
|
||||||
main() {
|
main() {
|
||||||
platform="$(uname -s)"
|
platform="$(uname -s)"
|
||||||
arch="$(uname -m)"
|
arch="$(uname -m)"
|
||||||
channel="stable"
|
channel="${ZED_CHANNEL:-stable}"
|
||||||
temp="$(mktemp -d "/tmp/zed-XXXXX")"
|
temp="$(mktemp -d "/tmp/zed-XXXXX")"
|
||||||
|
|
||||||
if [[ $platform == "Darwin" ]]; then
|
if [[ $platform == "Darwin" ]]; then
|
||||||
platform="macos"
|
platform="macos"
|
||||||
elif [[ $platform == "Linux" ]]; then
|
elif [[ $platform == "Linux" ]]; then
|
||||||
platform="linux"
|
platform="linux"
|
||||||
channel="nightly"
|
channel="${ZED_CHANNEL:-preview}"
|
||||||
else
|
else
|
||||||
echo "Unsupported platform $platform"
|
echo "Unsupported platform $platform"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -51,6 +51,7 @@ linux() {
|
||||||
suffix="-$channel"
|
suffix="-$channel"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -rf "$HOME/.local/zed$suffix.app"
|
||||||
mkdir -p "$HOME/.local/zed$suffix.app"
|
mkdir -p "$HOME/.local/zed$suffix.app"
|
||||||
tar -xzf "$temp/zed-linux-$arch.tar.gz" -C "$HOME/.local/"
|
tar -xzf "$temp/zed-linux-$arch.tar.gz" -C "$HOME/.local/"
|
||||||
|
|
||||||
|
@ -58,16 +59,17 @@ linux() {
|
||||||
ln -sf ~/.local/zed$suffix.app/bin/zed ~/.local/bin/
|
ln -sf ~/.local/zed$suffix.app/bin/zed ~/.local/bin/
|
||||||
cp ~/.local/zed$suffix.app/share/applications/zed$suffix.desktop ~/.local/share/applications/
|
cp ~/.local/zed$suffix.app/share/applications/zed$suffix.desktop ~/.local/share/applications/
|
||||||
sed -i "s|Icon=zed|Icon=$HOME/.local/zed$suffix.app/share/icons/hicolor/512x512/apps/zed.png|g" ~/.local/share/applications/zed$suffix.desktop
|
sed -i "s|Icon=zed|Icon=$HOME/.local/zed$suffix.app/share/icons/hicolor/512x512/apps/zed.png|g" ~/.local/share/applications/zed$suffix.desktop
|
||||||
sed -i "s|Exec=zed|Exec=$HOME/.local/zed$suffix.app/bin/zed|g" ~/.local/share/applications/zed.desktop
|
sed -i "s|Exec=zed|Exec=$HOME/.local/zed$suffix.app/bin/zed|g" ~/.local/share/applications/zed$suffix.desktop
|
||||||
|
|
||||||
if ! which zed >/dev/null 2>&1; then
|
if which zed >/dev/null 2>&1; then
|
||||||
|
echo "Zed has been installed. Run with 'zed'"
|
||||||
|
else
|
||||||
echo "To run zed from your terminal, you must add ~/.local/bin to your PATH"
|
echo "To run zed from your terminal, you must add ~/.local/bin to your PATH"
|
||||||
echo "Run:"
|
echo "Run:"
|
||||||
echo " echo 'export PATH=\$HOME/.local/bin:\$PATH' >> ~/.bashrc"
|
echo " echo 'export PATH=\$HOME/.local/bin:\$PATH' >> ~/.bashrc"
|
||||||
echo " source ~/.bashrc"
|
echo " source ~/.bashrc"
|
||||||
|
echo "To run zed now, '~/.local/bin/zed'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
~/.local/bin/zed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
macos() {
|
macos() {
|
||||||
|
@ -80,9 +82,10 @@ macos() {
|
||||||
echo "Removing existing $app"
|
echo "Removing existing $app"
|
||||||
rm -rf "/Applications/$app"
|
rm -rf "/Applications/$app"
|
||||||
fi
|
fi
|
||||||
ditto -v "$temp/mount/$app" "/Applications/$app"
|
ditto "$temp/mount/$app" "/Applications/$app"
|
||||||
hdiutil detach -quiet "$temp/mount"
|
hdiutil detach -quiet "$temp/mount"
|
||||||
open "/Applications/$app"
|
|
||||||
|
echo "Zed has been installed. Run with 'open /Applications/$app'"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue