diff --git a/build/ublue-os-just/00-default.just b/build/ublue-os-just/00-default.just index 28e996a5..ce19e4a3 100644 --- a/build/ublue-os-just/00-default.just +++ b/build/ublue-os-just/00-default.just @@ -55,3 +55,35 @@ distrobox-git: remove-distrobox-git: echo 'Uninstalling latest git snapshot of Distrobox...' curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/uninstall | sh -s -- --prefix ~/.local + +# Install Homebrew for Linux +brew-install: + echo "Installing homebrew ..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + +# Add Homebrew to shell rc files +brew-shell: + #!/usr/bin/env bash + set -euxo pipefail + echo "Adding homebrew to shell configuration" + touch $HOME/.zprofile + touch $HOME/.bash_profile + if grep -q "linuxbrew" $HOME/.zprofile + then + echo "Brew configuration already present in .zprofile" + else + echo "Adding Brew configuration to .zprofile" + echo 'eval "$(/var/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> $HOME/.zprofile + fi + if grep -q "linuxbrew" $HOME/.bash_profile + then + echo "Brew configuration already present in .bash_profile" + else + echo "Adding Brew configuration to .bash_profile" + echo 'eval "$(/var/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> $HOME/.bash_profile + fi + +# Removes homebrew from system +brew-remove: + echo "Removing homebrew ..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"