install2
This commit is contained in:
+9
-5
@@ -18,7 +18,7 @@ function install {
|
||||
cd /tmp
|
||||
|
||||
curl -sO $MAIN_TAR_GZ_URL
|
||||
sudo tar -xzf main.tar.gz --directory $(dirname "$MIAOU_BASH_DIR")
|
||||
sudo tar -xzf main.tar.gz --directory "$(dirname "$MIAOU_BASH_DIR")"
|
||||
execute_miaou_lib initiate
|
||||
|
||||
source /etc/profile
|
||||
@@ -28,7 +28,8 @@ function install {
|
||||
function assert_supported_distro {
|
||||
if ! grep -E '^ID=debian|^ID_LIKE=debian' /etc/os-release &&
|
||||
! grep -E '^ID=arch|^ID_LIKE=arch' /etc/os-release; then
|
||||
local distro=$(grep -oP '^ID=\K(.*)' /etc/os-release)
|
||||
local distro
|
||||
distro=$(grep -oP '^ID=\K(.*)' /etc/os-release)
|
||||
>&2 echo "unsupported GNU/Linux distribution: $distro"
|
||||
>&2 echo 'only debian-like OR arch-like currently supported'
|
||||
exit 2
|
||||
@@ -42,14 +43,17 @@ function once_installed {
|
||||
}
|
||||
|
||||
function execute_miaou_lib {
|
||||
sudo -E "$MIAOU_BASH_DIR"/bin/miaou-bash "$MIAOU_BASH_DIR/lib/"$1".bash"
|
||||
sudo -E "$MIAOU_BASH_DIR"/bin/miaou-bash "$MIAOU_BASH_DIR"/lib/"$1".bash
|
||||
}
|
||||
|
||||
function sudo_root {
|
||||
[[ "$UID" -ne 0 ]] && sudo -vp 'SUDO privilege required: '
|
||||
}
|
||||
## MAIN
|
||||
|
||||
# source <(curl -s https://git.artcode.re/miaou/miaou-bash/raw/branch/main/install2.sh)
|
||||
|
||||
set -Eeuo pipefail
|
||||
assert_supported_distro
|
||||
[[ "$UID" -ne 0 ]] && sudo -vp 'SUDO privilege required: '
|
||||
once_installed && upgrade || install
|
||||
sudo_root
|
||||
if once_installed; then upgrade; else install; fi
|
||||
|
||||
Reference in New Issue
Block a user