diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..afc63ba --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/README.md b/README.md index 668fefc..22df551 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,21 @@ -# install-jetbrains-toolbox-fedora -A Bash script to download and install JetBrains Toolbox on Fedora. This script ensures all necessary dependencies are installed and sets up the Toolbox in the appropriate directory for easy access and use. +# Install Jetbrains-toolbox for Fedora -Um script Bash para baixar e instalar o JetBrains Toolbox no Fedora. Este script garante que todas as dependências necessárias sejam instaladas e configura o Toolbox no diretório apropriado para fácil acesso e uso. +A Bash script to download and install JetBrains Toolbox on Fedora. + +This script ensures all necessary dependencies are installed and sets up the Toolbox in the appropriate directory for easy access and use. + +## How to setup on BASH/ZSH + +### Install & Update Script + +To install or update Jetbrains-toolbox, you should run the install script. To do that, you may either download and run the script manually, or use the following cURL or Wget command: + +```bash +curl -o- https://raw.githubusercontent.com/asapdotid/install-jetbrains-toolbox-fedora/refs/heads/main/install.sh | bash +``` + +or + +```bash +wget -qO- https://raw.githubusercontent.com/asapdotid/install-jetbrains-toolbox-fedora/refs/heads/main/install.sh | bash +``` diff --git a/install.sh b/install.sh index aad8864..6ae5998 100755 --- a/install.sh +++ b/install.sh @@ -1,28 +1,58 @@ -#!/bin/bash +#!/bin/bash/env bash -set -euo pipefail +{ + set -euo pipefail -# Instalar dependências -sudo dnf install -y jq fuse fuse-libs + # Install dependencies + sudo dnf install -y jq fuse fuse-libs -# Obter o link de download do JetBrains Toolbox -toolbox_url=$(curl -s 'https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release' \ - | jq -r '.TBA[0].downloads.linux.link') + # Download JetBrains Toolbox latest version + toolbox_url=$(curl -s 'https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release' | + jq -r '.TBA[0].downloads.linux.link') -# Diretório de destino -destination="${HOME}/.local/share/JetBrains/Toolbox/bin" + # Download JetBrains Toolbox icon + toolbox_icon_url='https://www.iconarchive.com/download/i105820/papirus-team/papirus-apps/jetbrains-toolbox.svg' -# Criar o diretório de destino se ele não existir -mkdir -p "$destination" + # Directory to download JetBrains Toolbox + jetbrains_destination="${HOME}/.local/share/JetBrains" -# Baixar e extrair o JetBrains Toolbox -curl -sL "$toolbox_url" | tar xzvf - \ - --directory="$destination" \ - --wildcards */jetbrains-toolbox \ - --strip-components=1 + # Directory to install JetBrains Toolbox + tb_destination="${jetbrains_destination}/Toolbox" + + # User shortcut file + shortcut_file="${HOME}/.local/share/applications/jetbrains-toolbox.desktop" -# Executar o JetBrains Toolbox -"$destination/jetbrains-toolbox" & + # Create destination directory + mkdir -p "$tb_destination" -echo "JetBrains Toolbox instalado e iniciado com sucesso em $destination" + # Extract JetBrains Toolbox to destination + curl -sL "$toolbox_url" | tar xzvf - \ + --directory="$tb_destination" \ + --strip-components=1 + # Place JetBrains Toolbox icon to destination + curl -sL "$toolbox_icon_url" -O --output-dir "$tb_destination" + + # Create desktop shortcut + cat >"${shortcut_file}" <