Skip to content

Commit

Permalink
refactor(nervous-system): add helper function to release-runscript
Browse files Browse the repository at this point in the history
  • Loading branch information
anchpop committed Feb 5, 2025
1 parent 3fbe84a commit 6b528ea
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions rs/nervous_system/tools/release-runscript/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ fn run_submit_proposals(cmd: SubmitProposals) -> Result<()> {
println!(" pkcs11-tool --list-slots");
println!("And you can practice entering your password with: ");
println!(" pkcs11-tool --login --test");
input("Press Enter to continue...")?;
press_enter_to_continue()?;

let ic = ic_dir();

Expand Down Expand Up @@ -545,10 +545,7 @@ fn run_create_forum_post(cmd: CreateForumPost) -> Result<()> {
})
);

print!("Press Enter to continue...");
io::stdout().flush()?;
let mut input = String::new();
io::stdin().read_line(&mut input)?;
press_enter_to_continue()?;
}

// --- Generate SNS forum post ---
Expand Down Expand Up @@ -594,10 +591,7 @@ fn run_create_forum_post(cmd: CreateForumPost) -> Result<()> {
})
);

print!("Press Enter to continue...");
io::stdout().flush()?;
let mut input = String::new();
io::stdin().read_line(&mut input)?;
press_enter_to_continue()?;
}

print_step(
Expand Down Expand Up @@ -721,10 +715,7 @@ fn print_step(number: usize, title: &str, description: &str) -> Result<()> {
);
println!("{}", "---".bright_blue());
println!("{}\n", description);
print!("\nPress Enter to continue to next step...");
io::stdout().flush()?;
let mut input = String::new();
io::stdin().read_line(&mut input)?;
press_enter_to_continue()?;
print!("\x1B[2J\x1B[1;1H");
Ok(())
}
Expand Down Expand Up @@ -786,3 +777,8 @@ fn input_yes_or_no(text: &str, default: bool) -> Result<bool> {
}
}
}

fn press_enter_to_continue() -> Result<()> {
input(&format!("\n{}", "Press Enter to continue...".bright_blue()))?;
Ok(())
}

0 comments on commit 6b528ea

Please sign in to comment.