lstk: use postflight_steps instead of deprecated postflight - #8
Conversation
Replaces the legacy `postflight` block with the structured
`postflight_steps` stanza, which is now required by Homebrew:
- `system_command` + `if OS.mac?` \u2192 `run` step with an `on_macos` guard
- Ruby interpolation `#{staged_path}` \u2192 `{{staged_path}}` template token
This eliminates the deprecation warning:
Warning: Calling `postflight` is deprecated! Use `postflight_steps` instead.
All step calls (`run`, `on_macos`) and the `{{staged_path}}` token are
permitted in cask `*_steps` blocks. Behavior is unchanged: the
quarantine attribute is still removed during installation.
There was a problem hiding this comment.
🟢 Approval recommended
The change cleanly migrates to the supported Homebrew Cask DSL (postflight_steps) without altering the intended post-install behavior.
Pull request overview
This PR updates the lstk cask to use Homebrew’s newer postflight_steps stanza to eliminate the deprecation warning emitted by the legacy postflight block, while keeping the post-install quarantine removal behavior intact.
Changes:
- Replaced
postflight do ... system_command ... endwithpostflight_steps do ... run ... end. - Added an
on_macosguard insidepostflight_stepsso thexattrcommand only runs on macOS. - Switched the staged path reference to the step-runner template token (
{{staged_path}}) for proper serialization/execution.
File summaries
| File | Description |
|---|---|
| Casks/lstk.rb | Migrates the post-install step to postflight_steps to remove the Homebrew deprecation warning while preserving the macOS quarantine attribute removal. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
joe4dev
left a comment
There was a problem hiding this comment.
Thank you for the quickfix @Dedsecproject
In general, we shouldn't edit lstk.rb manually as indicated by the comment # This file was generated by GoReleaser. DO NOT EDIT., but it won't hurt as it fixes the issue right away. It will be over-written with the next lstk release.
Mid-term, localstack/lstk#510 uses a custom block to generate a non-deprecated postflight_steps.
Long-term, we should adopt the out-of-the-box support of Golreleaser >=2.19, currently blocked by the open PR goreleaser/goreleaser#6873
Summary
Fixes the Homebrew deprecation warning emitted by
Casks/lstk.rb:Changes
Replaces the legacy
postflightblock with the structuredpostflight_stepsstanza required by Homebrew:system_command ...+if OS.mac?\u2192runstep guarded byon_macos#{staged_path}\u2192{{staged_path}}template token (supported by the step runner)Behavior is unchanged:
/usr/bin/xattr -dr com.apple.quarantineis still executed against the staged binary after installation.Verification
brew style: no offensesCask::Artifact::PostflightStepswith the serializedrunstep andon_macosguard, with no deprecation warningbrew install --cask localstack/tap/lstkon macOS (arm): installs successfully, quarantine attribute successfully removed by the post-install stepNote for maintainers
This tap appears to be generated by GoReleaser (the cask header says DO NOT EDIT). The upstream GoReleaser cask template still emits the legacy
postflightstanza, so the next generated tap update may reintroduce it \u2014 a fix in GoReleaser itself may also be warranted for a permanent solution.