install.sh: use per-channel binary names in ~/.local/bin (#11339)

Release Notes:

- N/A
This commit is contained in:
Thorsten Ball 2024-05-03 11:19:11 +02:00 committed by GitHub
parent cd03e473c8
commit 5ce45908b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -80,7 +80,8 @@ linux() {
mkdir -p "$HOME/.local/bin" "$HOME/.local/share/applications"
# Link the binary
ln -sf ~/.local/zed$suffix.app/bin/zed ~/.local/bin/
binary_name="zed${suffix}"
ln -sf ~/.local/zed$suffix.app/bin/zed "$HOME/.local/bin/${binary_name}"
# Copy .desktop file
desktop_file_path="$HOME/.local/share/applications/${appid}.desktop"
@ -88,14 +89,14 @@ linux() {
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}"
if which zed >/dev/null 2>&1; then
echo "Zed has been installed. Run with 'zed'"
if which "${binary_name}" >/dev/null 2>&1; then
echo "Zed has been installed. Run with '${binary_name}'"
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 " echo 'export PATH=\$HOME/.local/bin:\$PATH' >> ~/.bashrc"
echo " source ~/.bashrc"
echo "To run zed now, '~/.local/bin/zed'"
echo "To run Zed now, '~/.local/bin/${binary_name}'"
fi
}