-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modified package install function #83
base: master
Are you sure you want to change the base?
Conversation
Hi, thank you |
🔥 |
fi | ||
done | ||
# setup for arch-based systems | ||
sudo pacman -Syu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this implementation could have some side effects for OSs that don't match with redhat, SuSE, debian and Arch. I think it is better if it prints an error when it is a non tested system. Also, for linux distros there is a file called /etc/os-release
which has information about the distro and let us do something like this:
# Find the current distribution
if [ -f /etc/os-release ]; then
if grep -q arch /etc/os-release; then
os="arch-linux"
elif grep -q debian /etc/os-release; then
os="debian"
elif grep -q void /etc/os-release; then
os="void-linux"
elif grep -q alpine /etc/os-release; then
os="alpine"
elif grep -q fedora /etc/os-release; then
os="fedora"
else
echo "ERROR: I currently don't have support for your distro"
exit 1
fi
fi
Also, to match OS it is possible to do something like this https://github.com/ulises-jeremias/dotfiles/blob/master/util/os.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, I'll be fine with something like this after the for loop
if grep -q arch /etc/os-release; then
# setup for arch-based systems
sudo pacman -Syu
sudo pacman -S coreutils
sudo pacman -S $
else
echo "Error: I currently don't have support for your distro"
exit 1
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi thanks I will test it
No description provided.