mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-12-23 20:09:44 +00:00
feat: jetbrains-toolbox (#893)
* feat: jetbrains-toolbox * fix: formatting and shebang * Forgot the docs
This commit is contained in:
parent
1dec242548
commit
951cdc2d4c
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
. ../../common-script.sh
|
||||
|
||||
manualInstall() {
|
||||
JETBRAINS_TOOLBOX_DIR="/opt/jetbrains-toolbox"
|
||||
|
||||
case "$ARCH" in
|
||||
x86_64) ARCHIVE_URL=$(curl -s "https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release" | jq -r ".TBA[0].downloads.linux.link") ;;
|
||||
aarch64) ARCHIVE_URL=$(curl -s "https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release" | jq -r ".TBA[0].downloads.linuxARM64.link") ;;
|
||||
esac
|
||||
|
||||
curl -fSL "$ARCHIVE_URL" -o "jetbrains-toolbox.tar.gz"
|
||||
|
||||
if [ -d "$JETBRAINS_TOOLBOX_DIR" ]; then
|
||||
"$ESCALATION_TOOL" rm -rf "$JETBRAINS_TOOLBOX_DIR"
|
||||
fi
|
||||
|
||||
"$ESCALATION_TOOL" mkdir -p "$JETBRAINS_TOOLBOX_DIR"
|
||||
"$ESCALATION_TOOL" tar -xzf "jetbrains-toolbox.tar.gz" -C "$JETBRAINS_TOOLBOX_DIR" --strip-components=1
|
||||
"$ESCALATION_TOOL" ln -sf "$JETBRAINS_TOOLBOX_DIR/jetbrains-toolbox" "/usr/bin/jetbrains-toolbox"
|
||||
}
|
||||
|
||||
installJetBrainsToolBox() {
|
||||
if ! command_exists jetbrains-toolbox; then
|
||||
printf "%b\n" "${YELLOW}Installing Jetbrains Toolbox...${RC}"
|
||||
case "$PACKAGER" in
|
||||
pacman)
|
||||
"$AUR_HELPER" -S --needed --noconfirm jetbrains-toolbox
|
||||
;;
|
||||
dnf)
|
||||
manualInstall
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y libfuse2
|
||||
manualInstall
|
||||
;;
|
||||
esac
|
||||
printf "%b\n" "${GREEN}Successfully installed Jetbrains Toolbox.${RC}"
|
||||
else
|
||||
printf "%b\n" "${GREEN}Jetbrains toolbox is already installed.${RC}"
|
||||
fi
|
||||
}
|
||||
|
||||
checkEnv
|
||||
checkEscalationTool
|
||||
checkAURHelper
|
||||
installJetBrainsToolBox
|
|
@ -54,6 +54,12 @@ description = "GitHub Desktop is a user-friendly application that simplifies the
|
|||
script = "Developer-tools/githubdesktop-setup.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "JetBrains Toolbox"
|
||||
description = "JetBrains Toolbox is a collection of tools and an app that help developers work with JetBrains products."
|
||||
script = "Developer-tools/jetbrains-toolbox.sh"
|
||||
task_list = "I"
|
||||
|
||||
[[data.entries]]
|
||||
name = "Meld"
|
||||
description = "Meld is a visual diff and merge tool that helps compare files, directories, and version-controlled projects."
|
||||
|
|
|
@ -43,6 +43,16 @@ checkFlatpak() {
|
|||
fi
|
||||
}
|
||||
|
||||
checkArch() {
|
||||
case "$(uname -m)" in
|
||||
x86_64 | amd64) ARCH="x86_64" ;;
|
||||
aarch64 | arm64) ARCH="aarch64" ;;
|
||||
*) printf "%b\n" "${RED}Unsupported architecture: $(uname -m)${RC}" && exit 1 ;;
|
||||
esac
|
||||
|
||||
printf "%b\n" "${CYAN}System architecture: ${ARCH}${RC}"
|
||||
}
|
||||
|
||||
checkAURHelper() {
|
||||
## Check & Install AUR helper
|
||||
if [ "$PACKAGER" = "pacman" ]; then
|
||||
|
@ -156,6 +166,7 @@ checkDistro() {
|
|||
}
|
||||
|
||||
checkEnv() {
|
||||
checkArch
|
||||
checkEscalationTool
|
||||
checkCommandRequirements "curl groups $ESCALATION_TOOL"
|
||||
checkPackageManager 'nala apt-get dnf pacman zypper'
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
### Developer Tools
|
||||
|
||||
- **Github Desktop**: GitHub Desktop is a user-friendly application that simplifies the process of managing Git repositories and interacting with GitHub, providing a graphical interface for tasks like committing, branching, and syncing changes.
|
||||
- **JetBrains Toolbox**: JetBrains Toolbox is a collection of tools and an app that help developers work with JetBrains products.
|
||||
- **Meld**: Meld is a visual diff and merge tool that helps compare files, directories, and version-controlled projects.
|
||||
- **Neovim**: Neovim is a refactor, and sometimes redactor, in the tradition of Vim.
|
||||
It is not a rewrite but a continuation and extension of Vim.
|
||||
|
|
Loading…
Reference in New Issue
Block a user