From 3b1f0bd10ebd45beb6702c4af8d12aed07b4019a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Juri=C5=A1i=C4=87?= Date: Fri, 17 May 2024 14:38:55 +0200 Subject: [PATCH] Add user script for install vscodium extensions --- development/vscodium/vscodium-user-ext.sh | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 development/vscodium/vscodium-user-ext.sh diff --git a/development/vscodium/vscodium-user-ext.sh b/development/vscodium/vscodium-user-ext.sh new file mode 100755 index 0000000..aa3f496 --- /dev/null +++ b/development/vscodium/vscodium-user-ext.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +#### Variables +EXTENSIONS_PHP=(xdebug.php-debug zobo.php-intellisense lkrms.pretty-php) +EXTENSIONS_DB=(mtxr.sqltools) +EXTENSIONS_MISC=(foxundermoon.shell-format) + +#### Functions +check_notroot() { + if ! [ "$EUID" -ne 0 ]; then + echo "Must be non-root to run $0" + exit + fi +} + +choice() { + echo -ne "[y/n]" + while true; do + read -rN1 input + echo " " + case $input in + [yY][eE][sS] | [yY]) + return 0 + + break + ;; + [nN][oO] | [nN]) + return 1 + ;; + esac + done +} + +#### Main + +check_notroot + +echo -ne "\nYou want to install vscodium extensions for php (${EXTENSIONS_PHP[@]})? " +if choice 2>/dev/null; then + for EXT_NAME in "${EXTENSIONS_PHP[@]}"; do + codium --force --install-extension $EXT_NAME + done +fi + +echo -ne "\nYou want to install vscodium extensions for database (${EXTENSIONS_DB[@]})? " +if choice 2>/dev/null; then + for EXT_NAME in "${EXTENSIONS_DB[@]}"; do + codium --force --install-extension $EXT_NAME + done +fi + +echo -ne "\nYou want to install vscodium misc extensions (${EXTENSIONS_MISC[@]})? " +if choice 2>/dev/null; then + for EXT_NAME in "${EXTENSIONS_MISC[@]}"; do + codium --force --install-extension $EXT_NAME + done +fi