Skip to content

Commit

Permalink
fix(brew-update-service): install serviceman as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Jan 16, 2024
1 parent 396e34d commit 90344c5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions brew/brew-update-service-install
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ main() { (
sed '1,/^#~\/.local\/bin\/brew-updater/d' "${0}" > ~/.local/bin/brew-update-hourly
chmod a+x ~/.local/bin/brew-update-hourly

echo "Checking for serviceman..."
if ! command -v serviceman > /dev/null; then
"$HOME/.local/bin/webi" serviceman
export PATH="$HOME/.local/bin:$PATH"
serviceman --version
fi

env PATH="$PATH" serviceman add --user \
--workdir ~/.local/opt/brew/ \
--name sh.brew.updater -- \
~/.local/bin/brew-update-hourly
); }

if main; then
exit 0
if ! main; then
exit 1
fi
exit 0

#~/.local/bin/brew-updater
#!/bin/sh
Expand Down

0 comments on commit 90344c5

Please sign in to comment.