-
Notifications
You must be signed in to change notification settings - Fork 1
/
clion.sh
executable file
·34 lines (26 loc) · 1.15 KB
/
clion.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash -x
set -e
sudo apt-get update -y && sudo apt-get install jq
CLION_RELEASES_URL="https://data.services.jetbrains.com/products/releases?code=CL&latest=true&type=release"
# Se obtiene el link de descarga de la versión más reciente de CLion
ARCHITECTURE=$(case "$(dpkg --print-architecture)" in ("amd64") echo "linux" ;; ("arm64") echo "linuxARM64" ;; esac)
CLION_DOWNLOAD_URL=$(curl -fsSL "${CLION_RELEASES_URL:?}" | jq -r ".CL[0].downloads.${ARCHITECTURE:?}.link")
# Se descarga CLion desde el link de descarga oficial
wget -qO- "${CLION_DOWNLOAD_URL:?}" | sudo tar xvz -C /opt
# Se obtiene el nombre de la versión más reciente de CLion
CLION_VERSION=$(curl -fsSL "${CLION_RELEASES_URL:?}" | jq -r '.CL[0].version')
# Se agrega la entrada al escritorio
mkdir -pv ~/.local/share/applications
cat > ~/.local/share/applications/jetbrains-clion.desktop <<EOF
[Desktop Entry]
Version=1.0
Type=Application
Name=CLion
Icon=/opt/clion-${CLION_VERSION:?}/bin/clion.svg
Exec="/opt/clion-${CLION_VERSION:?}/bin/clion.sh" %f
Comment=A cross-platform IDE for C and C++
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-clion
StartupNotify=true
EOF