Add user script for install vscodium extensions
This commit is contained in:
parent
53e08f6791
commit
3b1f0bd10e
57
development/vscodium/vscodium-user-ext.sh
Executable file
57
development/vscodium/vscodium-user-ext.sh
Executable file
@ -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
|
Loading…
x
Reference in New Issue
Block a user