Skip to content

Commit

Permalink
fix arch installation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangou committed Dec 27, 2023
1 parent 2cbcb27 commit eff5cee
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions install_arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ packages=(
sd
tealdeer
zoxide

emacs
# npm
# python-pip

# Fonts
wqy-microhei
wqy-zenhei
)

# Use colors, but only if connected to a terminal, and that terminal
Expand All @@ -62,26 +54,20 @@ else
fi

function check() {
if ! command -v yay >/dev/null 2>&1 && ! command -v pacman >/dev/null 2>&1; then
if ! command -v pacman >/dev/null 2>&1; then
echo "${RED}Error: not Archlinux or its devrived edition.${NORMAL}" >&2
exit 1
fi
}

function install() {
CMD=''
if command -v yay >/dev/null 2>&1; then
CMD='yay -Ssu --noconfirm'
elif command -v pacman >/dev/null 2>&1; then
CMD='sudo pacman -Ssu --noconfirm'
else
echo "${RED}Error: not Archlinux or its devrived edition.${NORMAL}" >&2
exit 1
fi
printf "\n${BLUE}➜ Refreshing database...${NORMAL}\n"
sudo pacman -Syu
printf "\n"

for p in ${packages[@]}; do
printf "\n${BLUE}➜ Installing ${p}...${NORMAL}\n"
${CMD} ${p}
sudo pacman -Sc --needed --noconfirm ${p}
done
}

Expand Down

0 comments on commit eff5cee

Please sign in to comment.