wez / homebrew-wezterm

A Homebrew Tap for installing wezterm
MIT License
4 stars 6 forks source link

Switch from Homebrew Formula to Cask #2

Closed laggardkernel closed 3 years ago

laggardkernel commented 3 years ago

Propose to switch to Cask, which install the app into /Applications automatically for the user.

The 1st commit adds two Casks wezterm and wezterm-nightly.

The 2nd commit adds a disable! error to the old formula, and triggers a fake upgrade. When users install, or upgrade from the old formula, an Error pops up with guides for migration to the Casks. Here's what's the output,

❯ brew upgrade wezterm
Warning: Treating wezterm as a formula. For the cask, use wez/wezterm/wezterm
==> Upgrading 1 outdated package:
wez/wezterm/wezterm 20210522-migration-notice
==> Upgrading wez/wezterm/wezterm -> 20210522-migration-notice
Error: wez/wezterm/wezterm has been disabled because it is migrated from
current Formula to Casks 'wezterm' and 'wezterm-nightly'. With the new Casks,
the WezTerm.app will be put into /Applications/ automatically.

You should migrate to the new Cask right now.
If you have formula 'wezterm' installed, uninstall it first,
  brew uninstall --formula wezterm
  rm -rf /Applications/WezTerm.app
Then install WezTerm from the new cask 'wezterm',
  brew install --cask wezterm
or 'wezterm-nightly' for nightly build,
  brew install --cask wezterm-nightly

This formula may remain in the repo for a while to notice users migrate to the cask,
which results a name conflict between the formula 'wezterm' and the cask 'wezterm'.
Please pass '--cask' explicitly when doing an upgrade,
  brew upgrade --cask wezterm

Sorry about the trouble for you guys
!

The same Error pops up when doing brew install wezterm.

laggardkernel commented 3 years ago

I haven't heard about the --no-quarantine flag before reading from your comment. Seems I disabled it globally with defaults write com.apple.LaunchServices LSQuarantine -bool false.

I suggest adding it to the disable! block (the migration tips part) in Formula/wezterm.rb. Just like what you have updated in the doc.

    You should migrate to the new Cask right now.
    If you have formula 'wezterm' installed, uninstall it first,
      brew uninstall --formula wezterm
      rm -rf /Applications/WezTerm.app
    Then install WezTerm from the new cask 'wezterm',
-      brew install --cask wezterm
+      brew install --cask wezterm --no-quarantine
    or 'wezterm-nightly' for nightly build,
-      brew install --cask wezterm-nightly
+      brew install --cask wezterm-nightly --no-quarantine
wez commented 3 years ago

Done in ebbf38dbb868977a6f0e0bd06bfe67d34a517783