Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Add support for upgrading GitHub CLI Extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
rm3l authored and r-darwish committed Mar 23, 2022
1 parent 44cba22 commit ca4ffac
Show file tree
Hide file tree
Showing 3 changed files with 14 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 @@ -89,6 +89,7 @@ pub enum Step {
Fossil,
Gcloud,
Gem,
GithubCliExtensions,
GitRepos,
Go,
Haxelib,
Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ fn run() -> Result<()> {
runner.execute(Step::Micro, "micro", || generic::run_micro(run_type))?;
runner.execute(Step::Raco, "raco", || generic::run_raco_update(run_type))?;
runner.execute(Step::Spicetify, "spicetify", || generic::spicetify_upgrade(&ctx))?;
runner.execute(Step::GithubCliExtensions, "Github CLI Extensions", || {
generic::run_ghcli_extensions_upgrade(&ctx)
})?;

#[cfg(target_os = "linux")]
{
Expand Down
10 changes: 10 additions & 0 deletions src/steps/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,3 +475,13 @@ pub fn spicetify_upgrade(ctx: &ExecutionContext) -> Result<()> {
print_separator("Spicetify");
ctx.run_type().execute(&spicetify).arg("upgrade").check_run()
}

pub fn run_ghcli_extensions_upgrade(ctx: &ExecutionContext) -> Result<()> {
let gh = utils::require("gh")?;

print_separator("GitHub CLI Extensions");
ctx.run_type()
.execute(&gh)
.args(&["extension", "upgrade", "--all"])
.check_run()
}

0 comments on commit ca4ffac

Please sign in to comment.