linutil/core/tabs/applications-setup/developer-tools/zed.sh
Jeevitha Kannan K S e373f2cde8
refact: categorize dev scripts & add zed editor installation (#929)
* feat: Add zed editor -> developer tools

* Rename dir Developer-tools -> developer-tools

* Rename files from application-setup.sh -> application.sh

The purpose of all files inside the directory is to setup an application no need to mention it in the file name

* Revert userguide.md zed

* docs: new repo (#888)

* Removes docs and mentions on readme

* Update README.md

* Update README.md

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* Update linutil.yml

* Delete xtask.yml

* Update preview.yml

* Update README.md

---------

Co-authored-by: Chris Titus <contact@christitus.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* fix(create-bootable-usb.sh) confirmation prompt (#902)

* fix create-bootable-usb.sh confirmation prompt

* Update core/tabs/utils/create-bootable-usb.sh

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

---------

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* fix (ci): preview workflow (#905)

* fix: binary download, invalid action inputs

* Update preview.yml

---------

Co-authored-by: Real-MullaC <callumjanes2007new+github@gmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Lennart Pieperjohanns <95208734+lennartpj@users.noreply.github.com>
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2025-02-01 22:07:11 -06:00

53 lines
1.8 KiB
Bash

#!/bin/sh -e
. ../../common-script.sh
installZed() {
if ! command_exists dev.zed.Zed && ! command_exists zed && ! command_exists zeditor; then
printf "%b\n" "${CYAN}Installing Zed.${RC}"
case "$PACKAGER" in
apk)
"$ESCALATION_TOOL" "$PACKAGER" add zed
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S zed
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" addrepo -f https://download.opensuse.org/repositories/editors/openSUSE_Tumbleweed/editors.repo
"$ESCALATION_TOOL" "$PACKAGER" install -y zed
;;
*)
printf "%b\n" "${YELLOW}No official package found for package manager $PACKAGER. Do you want to install flathub package or from source?${RC}"
printf "%b\n" "1) Flathub package"
printf "%b\n" "2) Source"
printf "%b\n" "3) Exit"
printf "%b" "Choose an option: "
read -r choice
case "$choice" in
1)
checkFlatpak
flatpak install -y flathub dev.zed.Zed
;;
2)
curl -f https://zed.dev/install.sh | sh
;;
3)
printf "%b\n" "${GREEN}Exiting.${RC}"
exit 0
;;
*)
printf "%b\n" "${RED}Invalid option.${RC}"
exit 1
;;
esac
;;
esac
else
printf "%b\n" "${GREEN}Zed is already installed.${RC}"
fi
}
checkEnv
clear
installZed