Skip to content

Commit

Permalink
Update init-brew
Browse files Browse the repository at this point in the history
  • Loading branch information
dnkmmr69420 authored Apr 15, 2024
1 parent 5c583b4 commit fa22ffc
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions bin/init-brew
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
#!/bin/bash
mkdir -p $HOME/.local/share/clinuxbrew
mkdir -p $HOME/.local/share/clinuxbrew/exports/bin
sudo mkdir -p /home/linuxbrew
sudo mount --bind $HOME/.local/share/clinuxbrew /home/linuxbrew

if test ! -f /home/linuxbrew/.linuxbrew/bin/brew; then
echo "Installing brew..."
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
sudo chown $USER:$USER /home/linuxbrew
if test ! -f /etc/brew-inited; then
/usr/local/bin/reload-init
touch /etc/brew-inited
fi

if test ! -f "$HOME/.config/systemd/user/brew-container.service"; then
mkdir -p "$HOME/.config/systemd/user"
cp /usr/local/lib/cbrew/brew-container.service "$HOME/.config/systemd/user/brew-container.service"
distrobox-host-exec -Y systemctl enable --user --now brew-container.service
fi

[ -f /run/host/usr/bin/docker ] && sudo ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/docker || sudo rm -f /usr/local/bin/docker
[ -f /run/host/usr/bin/flatpak ] && sudo ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/flatpak || sudo rm -f /usr/local/bin/flatpak
[ -f /run/host/usr/bin/podman ] && sudo ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/podman || sudo rm -f /usr/local/bin/podman
[ -f /run/host/usr/bin/rpm-ostree ] && sudo ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/rpm-ostree || sudo rm -f /usr/local/bin/rpm-ostree
[ -f /run/host/usr/bin/transactional-update ] && sudo ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/transactional-update || sudo rm -f /usr/local/bin/transactional-update
[ -f /run/host/usr/bin/ujust ] && sudo ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/ujust || sudo rm -f /usr/local/bin/ujust

0 comments on commit fa22ffc

Please sign in to comment.