modules/homebrew: add link: :overwrite support
Homebrew supports `link: :overwrite` which runs `brew link --overwrite`, force-overwriting existing symlinks. Extract the existing `restart_service` special-case logic into a reusable helper (`mkBrewfileLineBoolOrSymbolString`) for options that can be either a bool or a Ruby symbol in the Brewfile.
This commit is contained in:
parent
36815b4852
commit
a3fd89f1bb
2 changed files with 24 additions and 17 deletions
|
|
@ -17,7 +17,7 @@ in
|
|||
|
||||
homebrew.user = "test-homebrew-user";
|
||||
|
||||
# Examples taken from https://github.com/Homebrew/homebrew-bundle
|
||||
# Examples adapted from https://docs.brew.sh/Brew-Bundle-and-Brewfile
|
||||
homebrew.taps = [
|
||||
"homebrew/cask"
|
||||
{
|
||||
|
|
@ -41,7 +41,8 @@ in
|
|||
{
|
||||
name = "denji/nginx/nginx-full";
|
||||
args = [ "with-rmtp" ];
|
||||
restart_service = "changed";
|
||||
link = "overwrite";
|
||||
restart_service = "always";
|
||||
}
|
||||
{
|
||||
name = "mysql@5.6";
|
||||
|
|
@ -89,7 +90,7 @@ in
|
|||
|
||||
echo "checking brew entries in Brewfile" >&2
|
||||
${mkTest "imagemagick" ''brew "imagemagick"''}
|
||||
${mkTest "denji/nginx/nginx-full" ''brew "denji/nginx/nginx-full", args: ["with-rmtp"], restart_service: :changed''}
|
||||
${mkTest "denji/nginx/nginx-full" ''brew "denji/nginx/nginx-full", args: ["with-rmtp"], link: :overwrite, restart_service: :always''}
|
||||
${mkTest "mysql@5.6" ''brew "mysql@5.6", conflicts_with: ["mysql"], link: true, restart_service: true''}
|
||||
|
||||
echo "checking cask entries in Brewfile" >&2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue