-
-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
postinstall
support for brew
and cask
This allows `postinstall` to be used to run a command after a formula or cask is installed. While we're here, also adjust the `restart_service` behaviour to correctly match the comment i.e. require `always` to restart every time and otherwise just restart on an install or upgrade of a formula.
- Loading branch information
1 parent
6c7f828
commit 874600a
Showing
5 changed files
with
159 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,10 +37,13 @@ cask_args appdir: "~/Applications", require_sha: true | |
|
||
# 'brew install' | ||
brew "imagemagick" | ||
# 'brew install --with-rmtp', 'brew link --overwrite', 'brew services restart' on version changes | ||
brew "denji/nginx/nginx-full", link: :overwrite, args: ["with-rmtp"], restart_service: :changed | ||
# 'brew install --with-rmtp', 'brew link --overwrite', 'brew services restart' even if no install/upgrade | ||
brew "denji/nginx/nginx-full", link: :overwrite, args: ["with-rmtp"], restart_service: :always | ||
# 'brew install', always 'brew services restart', 'brew link', 'brew unlink mysql' (if it is installed) | ||
brew "[email protected]", restart_service: true, link: true, conflicts_with: ["mysql"] | ||
# 'brew install' and run a command if installer or upgraded. | ||
brew "postgresql@16", | ||
postinstall: "${HOMEBREW_PREFIX}/opt/postgresql@16/bin/postgres -D ${HOMEBREW_PREFIX}/var/postgresql@16" | ||
# install only on specified OS | ||
brew "gnupg" if OS.mac? | ||
brew "glibc" if OS.linux? | ||
|
@@ -55,6 +58,8 @@ cask "firefox", args: { no_quarantine: true } | |
cask "opera", greedy: true | ||
# 'brew install --cask' only if '/usr/libexec/java_home --failfast' fails | ||
cask "java" unless system "/usr/libexec/java_home", "--failfast" | ||
# 'brew install --cask' and run a command if installer or upgraded. | ||
cask "google-cloud-sdk", postinstall: "${HOMEBREW_PREFIX}/bin/gcloud components update" | ||
|
||
# 'mas install' | ||
mas "1Password", id: 443_987_910 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters