committed by
GitHub
parent
30bc572c88
commit
593ff0a9bc
@@ -116,6 +116,7 @@ pub enum Step {
|
|||||||
Vcpkg,
|
Vcpkg,
|
||||||
Vim,
|
Vim,
|
||||||
Vscode,
|
Vscode,
|
||||||
|
Vscodium,
|
||||||
Wsl,
|
Wsl,
|
||||||
Yadm,
|
Yadm,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,6 +279,7 @@ fn run() -> Result<()> {
|
|||||||
)))]
|
)))]
|
||||||
runner.execute(Step::Atom, "apm", || generic::run_apm(run_type))?;
|
runner.execute(Step::Atom, "apm", || generic::run_apm(run_type))?;
|
||||||
runner.execute(Step::Vscode, "vscode", || generic::run_vscode(run_type))?;
|
runner.execute(Step::Vscode, "vscode", || generic::run_vscode(run_type))?;
|
||||||
|
runner.execute(Step::Vscodium, "vscodium", || generic::run_vscodium(run_type))?;
|
||||||
runner.execute(Step::Fossil, "fossil", || generic::run_fossil(run_type))?;
|
runner.execute(Step::Fossil, "fossil", || generic::run_fossil(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))?;
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ use crate::{
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use directories::BaseDirs;
|
use directories::BaseDirs;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use std::env;
|
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
use std::{env, path::Path};
|
||||||
use tempfile::tempfile_in;
|
use tempfile::tempfile_in;
|
||||||
|
|
||||||
pub fn run_cargo_update(run_type: RunType) -> Result<()> {
|
pub fn run_cargo_update(run_type: RunType) -> Result<()> {
|
||||||
@@ -90,15 +90,8 @@ pub fn run_fossil(run_type: RunType) -> Result<()> {
|
|||||||
run_type.execute(&fossil).args(&["all", "sync"]).check_run()
|
run_type.execute(&fossil).args(&["all", "sync"]).check_run()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_vscode(run_type: RunType) -> Result<()> {
|
pub fn run_vscode_variant(run_type: RunType, exe: &Path) -> Result<()> {
|
||||||
let vscode = utils::require("code")?;
|
let plugins = RunType::Wet.execute(&exe).args(&["--list-extensions"]).check_output()?;
|
||||||
|
|
||||||
print_separator("Visual Studio Code");
|
|
||||||
|
|
||||||
let plugins = RunType::Wet
|
|
||||||
.execute(&vscode)
|
|
||||||
.args(&["--list-extensions"])
|
|
||||||
.check_output()?;
|
|
||||||
|
|
||||||
let mut args = vec!["--force"];
|
let mut args = vec!["--force"];
|
||||||
|
|
||||||
@@ -107,11 +100,32 @@ pub fn run_vscode(run_type: RunType) -> Result<()> {
|
|||||||
args.push(plugin);
|
args.push(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
run_type.execute(&vscode).args(args).check_run()?;
|
if args.len() == 1 {
|
||||||
|
println!("No extensions to update");
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
run_type.execute(&exe).args(args).check_run()?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn run_vscodium(run_type: RunType) -> Result<()> {
|
||||||
|
let vscode = utils::require("codium")?;
|
||||||
|
|
||||||
|
print_separator("Visual Studio Codium");
|
||||||
|
|
||||||
|
run_vscode_variant(run_type, &vscode)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn run_vscode(run_type: RunType) -> Result<()> {
|
||||||
|
let vscode = utils::require("code")?;
|
||||||
|
|
||||||
|
print_separator("Visual Studio Code");
|
||||||
|
|
||||||
|
run_vscode_variant(run_type, &vscode)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn run_micro(run_type: RunType) -> Result<()> {
|
pub fn run_micro(run_type: RunType) -> Result<()> {
|
||||||
let micro = utils::require("micro")?;
|
let micro = utils::require("micro")?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user