diff --git a/homebrew/Casks/focusrite-volume-control.rb b/homebrew/Casks/focusrite-volume-control.rb index 9fcf9c5..ffec05f 100644 --- a/homebrew/Casks/focusrite-volume-control.rb +++ b/homebrew/Casks/focusrite-volume-control.rb @@ -7,11 +7,11 @@ url "https://github.com/enum-dot-dev/focusrite-volume-control/releases/download/v#{version}/VolumeControl.dmg" name "Volume Control" - desc "Control Focusrite Scarlett 4th gen volume with media keys via Focusrite Control 2" + desc "Control Scarlett 4th gen volume with media keys via Focusrite Control 2" homepage "https://enum.dev/focusrite-volume-control/" conflicts_with cask: "focusrite-volume-control@beta" - depends_on macos: ">= :sonoma" + depends_on macos: :sonoma app "Volume Control.app" diff --git a/scripts/render_cask.py b/scripts/render_cask.py index e556d07..0c2491f 100644 --- a/scripts/render_cask.py +++ b/scripts/render_cask.py @@ -2,8 +2,10 @@ """Render a Homebrew cask for a release from homebrew/Casks/focusrite-volume-control.rb. The release workflow copies the rendered casks into the tap repository, so this repo's -cask stays the single source of truth. Unsigned builds get a postflight that clears -the quarantine attribute, since Gatekeeper blocks un-notarized apps downloaded by brew. +cask stays the single source of truth. Unsigned builds get a postflight_steps stanza that +clears the quarantine attribute, since Gatekeeper blocks un-notarized apps downloaded by +brew. Homebrew deprecated Ruby flight blocks (`postflight do ... system_command ...`), so +the stanza uses the declarative steps DSL with an install-time {{appdir}} token. --beta renders focusrite-volume-control@beta instead. Both casks install the same app, so each one conflicts with the other. Only the beta cask accepts prerelease versions @@ -25,9 +27,9 @@ QUARANTINE_POSTFLIGHT = ''' # Unsigned build: clear quarantine so Gatekeeper doesn't block the app - postflight do - system_command "/usr/bin/xattr", - args: ["-cr", "#{appdir}/Volume Control.app"] + postflight_steps do + run "/usr/bin/xattr", + args: ["-cr", "{{appdir}}/Volume Control.app"] end ''' diff --git a/scripts/test_render_cask.py b/scripts/test_render_cask.py index afaaa2f..fe410a3 100644 --- a/scripts/test_render_cask.py +++ b/scripts/test_render_cask.py @@ -25,6 +25,7 @@ def test_stable(self): self.assertIn(f' sha256 "{SHA}"', cask) self.assertIn(f' conflicts_with cask: "{BETA_TOKEN}"', cask) self.assertNotIn("postflight do", cask) + self.assertNotIn("postflight_steps", cask) self.assertNotIn("auto_updates", cask) def test_beta_swaps_token_and_conflict(self): @@ -53,6 +54,11 @@ def test_unsigned_adds_quarantine_postflight_after_app(self): cask = render(template(), "1.6.0", SHA, unsigned=True, auto_updates=False) self.assertIn(' app "Volume Control.app"\n\n # Unsigned build', cask) self.assertIn('"/usr/bin/xattr"', cask) + # Homebrew deprecated Ruby flight blocks; the steps DSL takes {{...}} tokens, not #{...} + self.assertIn(" postflight_steps do\n", cask) + self.assertNotIn("postflight do", cask) + self.assertNotIn("system_command", cask) + self.assertIn('"{{appdir}}/Volume Control.app"', cask) def test_auto_updates_goes_before_conflicts_with(self): for beta in (False, True):