From c84a67b4e271f7c1f4ed93f511cac952949fa209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Thu, 23 Nov 2023 14:30:32 +0100 Subject: [PATCH] Check Gentoo file is exist in Update-pkg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .local/bin/Update-pkg | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.local/bin/Update-pkg b/.local/bin/Update-pkg index e819559..b7abb23 100755 --- a/.local/bin/Update-pkg +++ b/.local/bin/Update-pkg @@ -11,6 +11,7 @@ NC='\033[0m' PIPEXT="--user --force --quiet --break-system-packages" PIPEXTPRE="--pre $PIPEXT" +GENTOO="/etc/gentoo-release" # if [[ "$(uname -r)" =~ "gentoo" || "$(uname -r)" =~ "WSL2" ]]; then # PIPEXT="$PIPEXT --break-system-packages" @@ -38,7 +39,7 @@ function update_pip() { # Update the pip if [[ "$(uname)" == "Darwin" ]]; then python3 -m pip install --upgrade pip --user - elif [[ "$(uname -r)" =~ "gentoo" ]]; then + elif [[ -f $GENTOO ]]; then sudo emerge dev-python/pip fi } @@ -141,7 +142,7 @@ function install_go() { # Install the golang if [[ "$(uname)" == "Darwin" ]]; then brew install golang -q - elif [[ "$(uname -r)" =~ "gentoo" ]]; then + elif [[ -f $GENTOO ]]; then sudo emerge dev-lang/go fi } @@ -250,16 +251,17 @@ function install_speedtest() { function install_gh_cli() { if [[ "$(uname)" == "Darwin" ]]; then brew install gh - elif [[ "$(uname -r)" =~ "gentoo" ]]; then + elif [[ -f $GENTOO ]]; then sudo emerge dev-util/github-cli fi } function install_kubernetes() { + echo -e "$(uname -r)" if [[ "$(uname)" == "Darwin" ]]; then wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl" -O $HOME/.local/bin/kubectl chmod +x $HOME/.local/bin/kubectl - elif [[ "$(uname -r)" =~ "gentoo" ]]; then + else wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -O $HOME/.local/bin/kubectl chmod +x $HOME/.local/bin/kubectl fi