added support for Visual Studio Code (VSC) extension update (#628)

This commit is contained in:
Alex
2021-02-13 05:35:20 +01:00
committed by GitHub
parent 0fe0c70b2b
commit 878cad5c80
3 changed files with 19 additions and 0 deletions

View File

@@ -112,6 +112,7 @@ pub enum Step {
Vagrant, Vagrant,
Vcpkg, Vcpkg,
Vim, Vim,
VSCode,
WindowsAppStore, WindowsAppStore,
Wsl, Wsl,
Yadm, Yadm,

View File

@@ -277,6 +277,7 @@ fn run() -> Result<()> {
target_os = "netbsd", target_os = "netbsd",
target_os = "dragonfly" target_os = "dragonfly"
)))] )))]
runner.execute(Step::VSCode, "vscode", || generic::run_vscode(run_type))?;
runner.execute(Step::Atom, "apm", || generic::run_apm(run_type))?; runner.execute(Step::Atom, "apm", || generic::run_apm(run_type))?;
runner.execute(Step::Rustup, "rustup", || generic::run_rustup(&base_dirs, run_type))?; runner.execute(Step::Rustup, "rustup", || generic::run_rustup(&base_dirs, run_type))?;
runner.execute(Step::Dotnet, ".NET", || generic::run_dotnet_upgrade(&ctx))?; runner.execute(Step::Dotnet, ".NET", || generic::run_dotnet_upgrade(&ctx))?;

View File

@@ -79,6 +79,23 @@ pub fn run_sheldon(ctx: &ExecutionContext) -> Result<()> {
ctx.run_type().execute(&sheldon).args(&["lock", "--update"]).check_run() ctx.run_type().execute(&sheldon).args(&["lock", "--update"]).check_run()
} }
pub fn run_vscode(run_type: RunType) -> Result<()> {
let vscode = utils::require("code")?;
print_separator("Visual Studio Code");
let plugins = run_type.execute(&vscode).args(&["--list-extensions"]).check_output()?;
for plugin in plugins.lines() {
run_type
.execute(&vscode)
.args(&["--force", "--install-extension", plugin])
.check_run()?;
}
Ok(())
}
#[cfg(not(any( #[cfg(not(any(
target_os = "freebsd", target_os = "freebsd",
target_os = "openbsd", target_os = "openbsd",