Open
Conversation
Owner
|
Hi, thank you |
ulises-jeremias
approved these changes
Mar 11, 2021
|
🔥 |
| fi | ||
| done | ||
| # setup for arch-based systems | ||
| sudo pacman -Syu |
There was a problem hiding this comment.
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
fiAlso, 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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.