-
-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VSCodium (https://vscodium.com/) is a community-driven, freely-licensed binary distribution of Microsoft’s editor VS Code. The way extensions are exported and imported is the same as VSCode; There was a consideration to add version support (codium --list-extensions --show-versions) but it is not required as the IDE will update extensions itself
- Loading branch information
Showing
22 changed files
with
268 additions
and
57 deletions.
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.