[feature] move basic dependencies installation after mirros.sh

This commit is contained in:
Klesh Wong 2021-01-11 15:54:40 +08:00
parent 376a251183
commit 41104b4e14
3 changed files with 40 additions and 33 deletions

39
cli/basic.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
set -e
DIR=$(dirname "$(readlink -f "$0")")
. "$DIR/../env.sh"
log "Installing basic utilities"
case "$PM" in
apt)
sudo apt install \
build-essential \
unzip p7zip \
openssh-client \
curl wget \
man sudo
if [ -f /etc/lsb-release ]; then
set -a
. /etc/lsb-release
set +a
export DISTRIB_RELEASE_MAJOR=${DISTRIB_RELEASE%.*}
export DISTRIB_RELEASE_MINOR=${DISTRIB_RELEASE#.*}
fi
;;
pacman)
sudo pacman -S --noconfirm --needed \
base-devel \
unzip p7zip \
openssh \
curl wget \
man sudo
# install yay
if ! command -v yay >/dev/null; then
intorepo https://aur.archlinux.org/yay.git /tmp/yay
makepkg -si
exitrepo
fi
;;
esac

View File

@ -6,6 +6,7 @@ DIR=$(dirname "$(readlink -f "$0")")
timedatectl set-ntp on timedatectl set-ntp on
. "$DIR/mirrors.sh" . "$DIR/mirrors.sh"
. "$DIR/basic.sh"
. "$DIR/fish.sh" . "$DIR/fish.sh"
. "$DIR/vim.sh" . "$DIR/vim.sh"
. "$DIR/ranger.sh" . "$DIR/ranger.sh"

33
env.sh
View File

@ -91,39 +91,6 @@ if [ "$PM" = "n/a" ]; then
exit 1 exit 1
fi fi
log "Installing basic utilities"
case "$PM" in
apt)
sudo apt install \
build-essential \
unzip p7zip \
openssh-client \
curl wget \
man sudo
if [ -f /etc/lsb-release ]; then
set -a
. /etc/lsb-release
set +a
export DISTRIB_RELEASE_MAJOR=${DISTRIB_RELEASE%.*}
export DISTRIB_RELEASE_MINOR=${DISTRIB_RELEASE#.*}
fi
;;
pacman)
sudo pacman -S --noconfirm --needed \
base-devel \
unzip p7zip \
openssh \
curl wget \
man sudo
# install yay
if ! command -v yay >/dev/null; then
intorepo https://aur.archlinux.org/yay.git /tmp/yay
makepkg -si
exitrepo
fi
;;
esac
log "Environments" log "Environments"
echo " PM : $PM" echo " PM : $PM"