Skip to content

Commit

Permalink
feat: support miktex packages update (topgrade-rs#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
samhanic authored Aug 13, 2023
1 parent 021320b commit 2c9a56a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ pub enum Step {
Krew,
Macports,
Mamba,
Miktex,
Mas,
Maza,
Micro,
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ fn run() -> Result<()> {
runner.execute(Step::Pipx, "pipx", || generic::run_pipx_update(&ctx))?;
runner.execute(Step::Conda, "conda", || generic::run_conda_update(&ctx))?;
runner.execute(Step::Mamba, "mamba", || generic::run_mamba_update(&ctx))?;
runner.execute(Step::Miktex, "miktex", || generic::run_miktex_packages_update(&ctx))?;
runner.execute(Step::Pip3, "pip3", || generic::run_pip3_update(&ctx))?;
runner.execute(Step::PipReview, "pip-review", || generic::run_pip_review_update(&ctx))?;
runner.execute(Step::PipReviewLocal, "pip-review (local)", || {
Expand Down
10 changes: 10 additions & 0 deletions src/steps/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,16 @@ pub fn run_mamba_update(ctx: &ExecutionContext) -> Result<()> {
command.status_checked()
}

pub fn run_miktex_packages_update(ctx: &ExecutionContext) -> Result<()> {
let miktex = require("miktex")?;
print_separator("miktex");

ctx.run_type()
.execute(miktex)
.args(["packages", "update"])
.status_checked()
}

pub fn run_pip3_update(ctx: &ExecutionContext) -> Result<()> {
let py = require("python").and_then(check_is_python_2_or_shim);
let py3 = require("python3").and_then(check_is_python_2_or_shim);
Expand Down

0 comments on commit 2c9a56a

Please sign in to comment.