Check Gentoo file is exist in Update-pkg

Signed-off-by: Marcin Woźniak <marcin.wozniak@wundermanthompson.com>
This commit is contained in:
Marcin Woźniak 2023-11-23 14:30:32 +01:00
parent f8267a78a0
commit c84a67b4e2

View File

@ -11,6 +11,7 @@ NC='\033[0m'
PIPEXT="--user --force --quiet --break-system-packages" PIPEXT="--user --force --quiet --break-system-packages"
PIPEXTPRE="--pre $PIPEXT" PIPEXTPRE="--pre $PIPEXT"
GENTOO="/etc/gentoo-release"
# if [[ "$(uname -r)" =~ "gentoo" || "$(uname -r)" =~ "WSL2" ]]; then # if [[ "$(uname -r)" =~ "gentoo" || "$(uname -r)" =~ "WSL2" ]]; then
# PIPEXT="$PIPEXT --break-system-packages" # PIPEXT="$PIPEXT --break-system-packages"
@ -38,7 +39,7 @@ function update_pip() {
# Update the pip # Update the pip
if [[ "$(uname)" == "Darwin" ]]; then if [[ "$(uname)" == "Darwin" ]]; then
python3 -m pip install --upgrade pip --user python3 -m pip install --upgrade pip --user
elif [[ "$(uname -r)" =~ "gentoo" ]]; then elif [[ -f $GENTOO ]]; then
sudo emerge dev-python/pip sudo emerge dev-python/pip
fi fi
} }
@ -141,7 +142,7 @@ function install_go() {
# Install the golang # Install the golang
if [[ "$(uname)" == "Darwin" ]]; then if [[ "$(uname)" == "Darwin" ]]; then
brew install golang -q brew install golang -q
elif [[ "$(uname -r)" =~ "gentoo" ]]; then elif [[ -f $GENTOO ]]; then
sudo emerge dev-lang/go sudo emerge dev-lang/go
fi fi
} }
@ -250,16 +251,17 @@ function install_speedtest() {
function install_gh_cli() { function install_gh_cli() {
if [[ "$(uname)" == "Darwin" ]]; then if [[ "$(uname)" == "Darwin" ]]; then
brew install gh brew install gh
elif [[ "$(uname -r)" =~ "gentoo" ]]; then elif [[ -f $GENTOO ]]; then
sudo emerge dev-util/github-cli sudo emerge dev-util/github-cli
fi fi
} }
function install_kubernetes() { function install_kubernetes() {
echo -e "$(uname -r)"
if [[ "$(uname)" == "Darwin" ]]; then 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 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 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 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 chmod +x $HOME/.local/bin/kubectl
fi fi