Add ghcup step (#89)
This commit is contained in:
@@ -93,6 +93,7 @@ pub enum Step {
|
||||
Fossil,
|
||||
Gcloud,
|
||||
Gem,
|
||||
Ghcup,
|
||||
GithubCliExtensions,
|
||||
GitRepos,
|
||||
Go,
|
||||
|
||||
@@ -323,6 +323,7 @@ fn run() -> Result<()> {
|
||||
runner.execute(Step::Pipx, "pipx", || generic::run_pipx_update(run_type))?;
|
||||
runner.execute(Step::Conda, "conda", || generic::run_conda_update(&ctx))?;
|
||||
runner.execute(Step::Pip3, "pip3", || generic::run_pip3_update(run_type))?;
|
||||
runner.execute(Step::Ghcup, "ghcup", || generic::run_ghcup_update(run_type))?;
|
||||
runner.execute(Step::Stack, "stack", || generic::run_stack_update(run_type))?;
|
||||
runner.execute(Step::Tlmgr, "tlmgr", || generic::run_tlmgr_update(&ctx))?;
|
||||
runner.execute(Step::Myrepos, "myrepos", || {
|
||||
|
||||
@@ -289,12 +289,26 @@ pub fn run_pip3_update(run_type: RunType) -> Result<()> {
|
||||
}
|
||||
|
||||
pub fn run_stack_update(run_type: RunType) -> Result<()> {
|
||||
if let Ok(_) = utils::require("ghcup") {
|
||||
// `ghcup` is present and probably(?) being used to install `stack`.
|
||||
// Don't upgrade `stack`, let `ghcup` handle it. Per `ghcup install stack`:
|
||||
// !!! Additionally, you should upgrade stack only through ghcup and not use 'stack upgrade' !!!
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let stack = utils::require("stack")?;
|
||||
print_separator("stack");
|
||||
|
||||
run_type.execute(&stack).arg("upgrade").check_run()
|
||||
}
|
||||
|
||||
pub fn run_ghcup_update(run_type: RunType) -> Result<()> {
|
||||
let ghcup = utils::require("ghcup")?;
|
||||
print_separator("ghcup");
|
||||
|
||||
run_type.execute(&ghcup).arg("upgrade").check_run()
|
||||
}
|
||||
|
||||
pub fn run_tlmgr_update(ctx: &ExecutionContext) -> Result<()> {
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(any(target_os = "linux", target_os = "android"))] {
|
||||
|
||||
Reference in New Issue
Block a user