Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Conrad Irwin 2024-04-30 16:01:07 -06:00 committed by GitHub
parent d55b637b7e
commit 28bcc95468
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 18 deletions

29
script/install.sh Normal file → Executable file
View file

@ -43,32 +43,35 @@ main() {
}
linux() {
echo "Downloading zed.tar.gz"
# curl "https://zed.dev/api/download/zed.tar.gz?platform=$platform&arch=$arch&channel=$channel" > "$temp/zed.tar.gz"
echo "Downloading Zed"
curl "https://zed.dev/api/releases/$channel/latest/zed-linux-$arch.tar.gz" > "$temp/zed-linux-$arch.tar.gz"
mkdir -p "$HOME/.local/zed.app"
suffix=""
if [[ $channel != "stable" ]]; then
suffix="-$channel"
fi
mkdir -p "$HOME/.local/zed$suffix.app"
tar -xzf "$temp/zed-linux-$arch.tar.gz" -C "$HOME/.local/"
# Set up xdg links so that app shows in the dock
mkdir -p "$HOME/.local/bin" "$HOME/.local/share/applications"
ln -sf ~/.local/zed.app/bin/zed ~/.local/bin/
cp ~/.local/zed.app/share/applications/zed.desktop ~/.local/share/applications/
sed -i "s|Icon=zed|Icon=$HOME/.local/zed.app/share/icons/hicolor/512x512/apps/zed.png|g" ~/.local/share/applications/zed.desktop
sed -i "s|Exec=zed|Exec=$HOME/.local/zed.app/bin/zed|g" ~/.local/share/applications/zed.desktop
ln -sf ~/.local/zed$suffix.app/bin/zed ~/.local/bin/
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|Exec=zed|Exec=$HOME/.local/zed$suffix.app/bin/zed|g" ~/.local/share/applications/zed.desktop
if which zed >/dev/null 2>&1; then
else
if ! which zed >/dev/null 2>&1; then
echo "To run zed from your terminal, you must add ~/.local/bin to your PATH"
exit 1
echo "Run:"
echo " echo 'export PATH=\$HOME/.local/bin:\$PATH' >> ~/.bashrc"
echo " source ~/.bashrc"
fi
~/.local/bin/zed
}
macos() {
echo "Downloading Zed.dmg..."
echo "Downloading Zed"
curl "https://zed.dev/api/releases/$channel/latest/Zed-$arch.dmg" > "$temp/Zed-$arch.dmg"
hdiutil attach -quiet "$temp/Zed-$arch.dmg" -mountpoint "$temp/mount"
app="$(cd "$temp/mount/"; echo *.app)"