Add support for Linux to visual-studio-code cask #228061
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.
In the following questions
<cask>is the token of the cask you're submitting.After making any changes to a cask, existing or new, verify:
brew audit --cask --online <cask>is error-free.brew style --fix <cask>reports no offenses.Additionally, if adding a new cask: (since linux support is new, I tested this also)
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask>worked successfully.brew uninstall --cask <cask>worked successfully.I wanted to add Linux support to this cask. It can be quite useful for Immutable systems and other linux usecases that can't use the DEB/RPM route.
I am new to making homebrew recipes and cask, and I am sure I have made many mistakes, so I would appreciate any feedback.
I am particularly concerned if it is ok to even use the
if os ==code, or if there is a better way to organize the file, as I am also concerned about the order of directives. Maybe I do a bit more duplication and put more stuff inon_linuxand move the macos stuff toon_macos?Also I don't know if there is a variable or function i can use to get
/home/linuxbrew/.linuxbrew/Caskroom/<cask>as a path, instead of hardcoding it.I also had to use some methods to handle the difference in naming for linux and macos on the VSCode URLs. For macos it is
darwinanddarwin-arm64while linux islinux-x64andlinux-arm64The Cask cookbook docs were a little incorrect, as it instructed me to put the
module Utilsinside thecaskblock, and usedself.methods, while the stylecheck changed things up. Let me know if there is a different way to do this.EDIT: I forgot to ask, is there a way to add one-off files that are not part of the package? There are 2
.desktopfiles I need to add to~/.local/share/applicationso that this app shows up in the Launchers in linux, but they are not included in thetar.gzfile option on the vscode download, only in therpmanddeb. Or a way to download extra files?EDIT2: I also don't have a mac to test the mac side of things.