feat: implement homebrew as handler for mac

This commit is contained in:
MoturiFranklin 2024-07-13 20:38:59 +03:00
parent 13aefb37d8
commit 70273256e5
7 changed files with 11 additions and 6 deletions

1
depends_brew Normal file
View file

@ -0,0 +1 @@
docker

View file

@ -15,9 +15,10 @@ export dir_home="$(dirname $(find "$INSTALEE_HOME" \
-maxdepth 1 -name "handlers.available*" 2>/dev/null | head -1))" -maxdepth 1 -name "handlers.available*" 2>/dev/null | head -1))"
handlersfile="$dir_home/handlers.available" handlersfile="$dir_home/handlers.available"
dir_packages="$dir_home/packages" dir_packages="$dir_home/packages"
which tac || alias tac="tail -r"
highlight() { echo $2 "$1" >&2; } highlight() { ${2:-echo} "$1" >&2; }
destress() { echo $2 "$1" >&2; } destress() { ${2:-echo} "$1" >&2; }
listhandlers() { listhandlers() {
( (
@ -98,7 +99,7 @@ installpkg() {
pkg_entry="$(find "$handler" -name "install") $1" pkg_entry="$(find "$handler" -name "install") $1"
fi fi
else else
destress " running unhandled" -n destress " running unhandled" printf
fi fi
destress " $pkg_entry" destress " $pkg_entry"
$pkg_entry $pkg_entry
@ -193,9 +194,9 @@ if ! test -f "$handlersfile"
then then
copy="$(case "$(uname)" in copy="$(case "$(uname)" in
(MINGW64*) echo "$dir_home/handlers.available.windows";; (MINGW64*) echo "$dir_home/handlers.available.windows";;
(DARWIN) echo "$dir_home/handlers.available.mac";; (Darwin) echo "$dir_home/handlers.available.mac";;
(*) ls "$dir_home/$({ cat /etc/os-release | grep -E '^ID(_LIKE)?=' | cut -d= -f2 | grep . || lsb_release -s -i | tr 'A-Z' 'a-z'; } | (*) os="$({ cat /etc/os-release | grep -E '^ID(_LIKE)?=' || lsb_release -s -i; })" &&
sed 's/^/handlers.available./' | paste -d' ' -s)" 2>/dev/null | head -1;; ls "$dir_home/$(echo "$os" | tr 'A-Z' 'a-z' | cut -d= -f2 | sed 's/^/handlers.available./' | paste -d' ' -s)" 2>/dev/null | head -1;;
esac)" && esac)" &&
test -n "$copy" && test -n "$copy" &&
echo "Bootstrapping available handlers from $copy" && echo "Bootstrapping available handlers from $copy" &&

2
packages/brew/bash Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

View file

1
packages/docker/brew Normal file
View file

@ -0,0 +1 @@
docker calima