Updated
This commit is contained in:
65
devleop/composer/composer-install.sh
Executable file
65
devleop/composer/composer-install.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
#### Variables
|
||||
APT_INST="apt -y install"
|
||||
|
||||
PKG_DEPS=(php)
|
||||
|
||||
#### Functions
|
||||
check_root() {
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Must be root to run $0"
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
choice() {
|
||||
echo -ne "[y/n]"
|
||||
while true
|
||||
do
|
||||
read -rN1 input
|
||||
case $input in
|
||||
[yY][eE][sS]|[yY])
|
||||
return 0
|
||||
|
||||
break
|
||||
;;
|
||||
[nN][oO]|[nN])
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
check_deps() {
|
||||
for PKG_NAME in "${PKG_DEPS[@]}"
|
||||
do
|
||||
if ! [ -x "$(command -v $PKG_NAME)" ]; then
|
||||
echo "Error: $PKG_NAME is not installed." >&2
|
||||
|
||||
echo -ne "\nInstall $PKG_NAME ? "
|
||||
if choice 2>/dev/null; then
|
||||
echo -ne "\n$APT_INST $PKG_NAME\n"
|
||||
$APT_INST $PKG_NAME
|
||||
else
|
||||
echo -ne "\n\nAbort install script, package $PKG_NAME is required for work composer.\n"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
composer_install() {
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||||
php composer-setup.php
|
||||
php -r "unlink('composer-setup.php');"
|
||||
mv composer.phar /usr/local/bin/composer
|
||||
}
|
||||
|
||||
#### Main
|
||||
|
||||
check_root
|
||||
check_deps
|
||||
composer_install
|
||||
55
devleop/vscodium/vscodium-install.sh
Executable file
55
devleop/vscodium/vscodium-install.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
#### Variables
|
||||
APT_UPDATE="apt -y update"
|
||||
APT_INST="apt -y install"
|
||||
APT_PURGE="apt -y purge"
|
||||
APT_REMOVE="apt -y autoremove"
|
||||
|
||||
PKG_NAME="codium"
|
||||
|
||||
|
||||
#### Functions
|
||||
check_root() {
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Must be root to run $0"
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
choice() {
|
||||
echo -ne "[y/n]"
|
||||
while true
|
||||
do
|
||||
read -rN1 input
|
||||
case $input in
|
||||
[yY][eE][sS]|[yY])
|
||||
return 0
|
||||
|
||||
break
|
||||
;;
|
||||
[nN][oO]|[nN])
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
#### Main
|
||||
|
||||
check_root
|
||||
|
||||
echo -e "\nUpdate apt"
|
||||
echo "$APT_UPDATE"
|
||||
$APT_UPDATE
|
||||
|
||||
echo -ne "\nYou want to install vscodium ($PKG_NAME)? "
|
||||
if choice 2>/dev/null; then
|
||||
echo -ne "\nAdd repository for vscodium\n"
|
||||
$APT_INST apt-transport-https wget
|
||||
wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | sudo dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg
|
||||
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' | sudo tee /etc/apt/sources.list.d/vscodium.list
|
||||
$APT_UPDATE
|
||||
echo -ne "\n$APT_INST $PKG_NAME\n"
|
||||
$APT_INST $PKG_NAME
|
||||
fi
|
||||
Reference in New Issue
Block a user