mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 13:22:28 +00:00
cca2660c3b
* increase synergy between scripts * Fix newlines Fix packagers etc * fix an issue with no new line being created * fix formatting Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * fix extra comma Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * change to () Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * change to () Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * change to () Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * change to () Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * remove extra comma Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * remove "please" Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add support for caps Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add support for caps Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add support for caps Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * remove \n and make the default option "N" Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add an extra quote Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add extra quotes * fix remaining sn * fix remaining new lines --------- Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com> Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
63 lines
2.6 KiB
Bash
Executable File
63 lines
2.6 KiB
Bash
Executable File
#!/bin/sh -e
|
|
|
|
. ../common-script.sh
|
|
|
|
installLinutil() {
|
|
printf "%b\n" "${YELLOW}Installing Linutil...${RC}"
|
|
case "$PACKAGER" in
|
|
pacman)
|
|
printf "%b\n" "-----------------------------------------------------"
|
|
printf "%b\n" "Select the package to install:"
|
|
printf "%b\n" "1. ${CYAN}linutil${RC} (stable release compiled from source)"
|
|
printf "%b\n" "2. ${CYAN}linutil-bin${RC} (stable release pre-compiled)"
|
|
printf "%b\n" "3. ${CYAN}linutil-git${RC} (compiled from the latest commit)"
|
|
printf "%b\n" "-----------------------------------------------------"
|
|
printf "%b" "Enter your choice: "
|
|
read -r choice
|
|
case $choice in
|
|
1) "$AUR_HELPER" -S --noconfirm linutil ;;
|
|
2) "$AUR_HELPER" -S --noconfirm linutil-bin ;;
|
|
3) "$AUR_HELPER" -S --noconfirm linutil-git ;;
|
|
*)
|
|
printf "%b\n" "${RED}Invalid choice:${RC} $choice"
|
|
exit 1
|
|
;;
|
|
esac
|
|
printf "%b\n" "${GREEN}Installed successfully.${RC}"
|
|
;;
|
|
*)
|
|
printf "%b\n" "${RED}There are no official packages for your distro.${RC}"
|
|
printf "%b" "${YELLOW}Do you want to install the crates.io package? (y/N): ${RC}"
|
|
read -r choice
|
|
case $choice in
|
|
y|Y)
|
|
if ! command_exists cargo; then
|
|
printf "%b\n" "${YELLOW}Installing rustup...${RC}"
|
|
case "$PACKAGER" in
|
|
pacman)
|
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rustup
|
|
;;
|
|
zypper)
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
. $HOME/.cargo/env
|
|
;;
|
|
*)
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup
|
|
;;
|
|
esac
|
|
fi
|
|
rustup default stable
|
|
cargo install --force linutil_tui
|
|
printf "%b\n" "${GREEN}Installed successfully.${RC}"
|
|
;;
|
|
*) printf "%b\n" "${RED}Linutil not installed.${RC}" ;;
|
|
esac
|
|
esac
|
|
}
|
|
|
|
checkEnv
|
|
checkEscalationTool
|
|
checkAURHelper
|
|
installLinutil
|