New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cask/installer: ensure config_path exists. #14340
cask/installer: ensure config_path exists. #14340
Conversation
I encountered this when installing `microsoft-edge`. Perhaps `HOMEBREW_INSTALL_FROM_API` related.
Review period skipped due to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work. It doesn't create the proper metadata subdirectory which means that Homebrew won't acknowledge the installed cask. Try running brew list microsoft-edge
after doing an API install:
$ brew install microsoft-edge
==> Downloading https://officecdn-microsoft-com.akamaized.net/pr/03adf619-38c6-4249-95ff-4a01c0ffc962/MacAutoupdate/MicrosoftEdge-108.0.1462.76.pkg
Already downloaded: /Users/rylanpolster/Library/Caches/Homebrew/downloads/51b73235a15423fc77a44e175eb47e39a1ce928d21c98ddecc1202f6fcc3b857--MicrosoftEdge-108.0.1462.76.pkg
==> Installing Cask microsoft-edge
==> Running installer for microsoft-edge; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
installer: Package name is Microsoft Edge
installer: choices changes file '/private/tmp/choices20230108-38897-10plymd.xml' applied
installer: Upgrading at base path /
installer: The upgrade was successful.
🍺 microsoft-edge was successfully installed!
$ brew list microsoft-edge
Error: Cask 'microsoft-edge' is not installed.
The line that needs to be added is:
brew/Library/Homebrew/cask/installer.rb
Line 385 in 106af03
savedir = @cask.metadata_subdir("Casks", timestamp: :now, create: true) |
It probably makes the most sense for this to go in its own method that's called by save_caskfile
and save_config_file
.
It's also worth noting that since we no longer download the cask source files from the API unless needed, most cask installs won't have the case source written to the .metadata
directory. If this is something we want to make sure to have, we'll probably have to do a source-file download every time.
I pushed a change implementing how I think it should be fixed. Happy to hear your thoughts. I've tested this on |
Good point, didn't think of that. I think that's fine for now but may be something we reconsider later. |
Thanks @Rylan12! |
I encountered this when installing
microsoft-edge
.Perhaps
HOMEBREW_INSTALL_FROM_API
related CC @Rylan12