Add ghcup step (#89)

This commit is contained in:
Rebecca Turner
2022-10-30 12:34:14 -04:00
committed by GitHub
parent 5a6f0d2e15
commit 18cec5c9fa
3 changed files with 16 additions and 0 deletions

View File

@@ -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"))] {