✨ Add service start to brew_install; update config
This commit is contained in:
parent
54745b36fe
commit
7d6a2a0f94
2 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
set -gx HOMEBREW_NO_ANALYTICS 1
|
||||
|
||||
if status --is-interactive
|
||||
eval (/usr/local/Homebrew/bin/brew shellenv fish)
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@ end
|
|||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
function brew_install -a formula_readable_name formula arguments tap_value
|
||||
function brew_install -a formula_readable_name formula arguments tap_value service
|
||||
# Check that Homebrew is installed
|
||||
if ! cmd_exists "brew"
|
||||
print_error "$formula_readable_name ('Homebrew' is not installed)"
|
||||
|
@ -44,11 +44,16 @@ function brew_install -a formula_readable_name formula arguments tap_value
|
|||
end
|
||||
end
|
||||
|
||||
# Determine if a service needs to be started & restarted on login.
|
||||
if set -q service
|
||||
set -f service_cmd "&& brew services start $formula"
|
||||
end
|
||||
|
||||
# Install the formula.
|
||||
if brew list "$formula" &>/dev/null
|
||||
print_success "$formula_readable_name"
|
||||
else
|
||||
execute "brew install $formula $arguments" \
|
||||
execute "brew install $formula $arguments $service_cmd" \
|
||||
"$formula_readable_name"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue