-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Add support for VSCodium #1560
Open
helgi
wants to merge
1
commit into
Homebrew:master
Choose a base branch
from
helgi:vscodium
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add support for VSCodium #1560
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
module Bundle | ||
module Checker | ||
class VscodiumExtensionChecker < Bundle::Checker::Base | ||
PACKAGE_TYPE = :vscodium | ||
PACKAGE_TYPE_NAME = "VSCodium Extension" | ||
|
||
def failure_reason(extension, no_upgrade:) | ||
"#{PACKAGE_TYPE_NAME} #{extension} needs to be installed." | ||
end | ||
|
||
def installed_and_up_to_date?(extension, no_upgrade: false) | ||
Bundle::VscodiumExtensionInstaller.extension_installed?(extension) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module Bundle | ||
module VscodiumExtensionDumper | ||
module_function | ||
|
||
def reset! | ||
@extensions = nil | ||
end | ||
|
||
def extensions | ||
@extensions ||= if Bundle.vscodium_installed? | ||
Bundle.exchange_uid_if_needed! do | ||
`codium --list-extensions 2>/dev/null` | ||
end.split("\n").map(&:downcase) | ||
else | ||
[] | ||
end | ||
end | ||
|
||
def dump | ||
extensions.map { |name| "vscodium \"#{name}\"" }.join("\n") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# frozen_string_literal: true | ||
|
||
module Bundle | ||
module VscodiumExtensionInstaller | ||
module_function | ||
|
||
def reset! | ||
@installed_extensions = nil | ||
end | ||
|
||
def preinstall(name, no_upgrade: false, verbose: false) | ||
if !Bundle.vscodium_installed? && Bundle.cask_installed? | ||
puts "Installing vscodium. It is not currently installed." if verbose | ||
Bundle.system HOMEBREW_BREW_FILE, "install", "--cask", "vscodium", verbose: | ||
end | ||
|
||
if extension_installed?(name) | ||
puts "Skipping install of #{name} VSCodium extension. It is already installed." if verbose | ||
return false | ||
end | ||
|
||
raise "Unable to install #{name} VSCodium extension. VSCodium is not installed." unless Bundle.vscodium_installed? | ||
Check failure on line 22 in lib/bundle/vscodium_extension_installer.rb GitHub Actions / tests (ubuntu-latest)
Check failure on line 22 in lib/bundle/vscodium_extension_installer.rb GitHub Actions / tests (ubuntu-latest)
Check failure on line 22 in lib/bundle/vscodium_extension_installer.rb GitHub Actions / tests (macOS-latest)
|
||
|
||
true | ||
end | ||
|
||
def install(name, preinstall: true, no_upgrade: false, verbose: false, force: false) | ||
return true unless preinstall | ||
return true if extension_installed?(name) | ||
|
||
puts "Installing #{name} VSCodium extension. It is not currently installed." if verbose | ||
|
||
return false unless Bundle.exchange_uid_if_needed! do | ||
Bundle.system("codium", "--install-extension", name, verbose:) | ||
end | ||
|
||
installed_extensions << name | ||
|
||
true | ||
end | ||
|
||
def extension_installed?(name) | ||
installed_extensions.include? name.downcase | ||
end | ||
|
||
def installed_extensions | ||
@installed_extensions ||= Bundle::VscodiumExtensionDumper.extensions | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Can this not just use the existing
vscode
? If not: why not?