Skip to content

Commit ff346f1

Browse files
Merge pull request #25 from pcriv/fix-cask-postflight-deprecation
fix: replace deprecated cask postflight hook with postflight_steps
2 parents 9148c20 + 809f064 commit ff346f1

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

‎.goreleaser.yml‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,23 @@ homebrew_casks:
7373
- name: powerctl
7474
binaries: [powerctl]
7575
homepage: "https://github.com/KristofferRisa/powerctl-cli"
76-
description: "CLI tool for monitoring electricity consumption and tracking power costs via Tibber"
76+
description: "Monitor electricity consumption and track power costs via Tibber"
7777
commit_msg_template: "chore: powerctl {{ .Tag }}"
7878
# Never point the tap at a prerelease (e.g. the -rc tags draft_release.yml cuts).
7979
skip_upload: "auto"
8080
# The release binaries are unsigned, so macOS would quarantine them.
81-
hooks:
82-
post:
83-
install: |
84-
if OS.mac?
85-
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/powerctl"]
86-
end
81+
#
82+
# GoReleaser's hooks.post.install always renders the deprecated Ruby
83+
# `postflight do` stanza (Homebrew's Cask/InstallSteps cop now requires
84+
# `postflight_steps`), and there is no hooks field that emits it as of
85+
# the pinned "~> v2" GoReleaser release, so it's written directly via
86+
# custom_block instead. See https://github.com/KristofferRisa/powerctl-cli/issues/24.
87+
custom_block: |
88+
postflight_steps do
89+
on_macos do
90+
run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "powerctl"], chdir: "."
91+
end
92+
end
8793
repository:
8894
owner: KristofferRisa
8995
name: homebrew-powerctl

0 commit comments

Comments
 (0)