Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

freebased
Copy link

No description provided.

@Gictorbit
Copy link
Owner

Hi, thank you
I will merge your changes after review so please keep it open

@Gictorbit Gictorbit self-assigned this Jan 27, 2021
@Gictorbit Gictorbit added the enhancement New feature or request label Jan 27, 2021
@ulises-jeremias
Copy link

🔥

fi
done
# setup for arch-based systems
sudo pacman -Syu
Copy link

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

Copy link

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

Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants