Files
fluffy-pancake/files/usr/local/bin/install-homebrew.sh
T
humocs-manandGitHub 339b011db8 Refactor Homebrew installation script
Removed user check and installation confirmation for Homebrew. Added export of HOME and updated installation command.
2026-03-15 17:59:18 +01:00

18 lines
507 B
Bash

#!/usr/bin/env bash
set -euo pipefail
USER="$1"
HOME="/var/home/$USER"
export HOME
export NONINTERACTIVE=1
# Homebrew installieren (als User, aber ohne Interaktion)
sudo -u "$USER" HOME="$HOME" NONINTERACTIVE=1 bash -c \
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
# Optional: Brew in PATH eintragen
if ! grep -q 'linuxbrew' "$HOME/.bashrc"; then
echo 'eval "$(/var/home/'"$USER"'/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> "$HOME/.bashrc"
fi