Skip to content

Commit

Permalink
support other Debian releases
Browse files Browse the repository at this point in the history
  • Loading branch information
civita committed Dec 2, 2021
1 parent ba67355 commit f142d13
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ function yes_or_no {
function install {
if [ -n "$(uname -a | grep Darwin)" ]; then
brew install $1
elif [ -n "$(cat /etc/os-release 2> /dev/null | grep Ubuntu)" ]; then
elif [ -n "$(cat /etc/os-release 2> /dev/null | grep debian)" ]; then
if ! command -v sudo &> /dev/null; then
apt install $1
else
sudo apt install $1
fi
else
printf "${RED}This script only runs on Ubuntu / macOS.${NC}\n\n"
printf "${RED}This script only runs on Debian / macOS.${NC}\n\n"
exit
fi
}
Expand Down Expand Up @@ -107,16 +107,16 @@ if [ -n "$(uname -a | grep Darwin)" ]; then
if ! command -v brew &> /dev/null; then
yes_or_no "Install Homebrew (https://brew.sh)?" && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
elif [ -n "$(cat /etc/os-release 2> /dev/null | grep Ubuntu)" ]; then
printf "${GREEN}Hi! Ubuntu user,${NC}\n\n"
elif [ -n "$(cat /etc/os-release 2> /dev/null | grep debian)" ]; then
printf "${GREEN}Hi! Debian user,${NC}\n\n"
# apt
if ! command -v sudo &> /dev/null; then
yes_or_no "Update package list?" && apt update
else
yes_or_no "Update package list?" && sudo apt update
fi
else
printf "${RED}This script only runs on Ubuntu / macOS.${NC}\n\n"
printf "${RED}This script only runs on Debian / macOS.${NC}\n\n"
exit
fi

Expand Down

0 comments on commit f142d13

Please sign in to comment.