Add solana-install-init binary (#4613)

* Add solana-install-init binary

* Add Enter prompt on solana-install-init exit for Windows users
This commit is contained in:
Michael Vines
2019-06-08 19:01:22 -07:00
committed by GitHub
parent 9f46b2a6ce
commit 0595109f98
8 changed files with 146 additions and 24 deletions

View File

@@ -0,0 +1,27 @@
use std::process::exit;
#[cfg(windows)]
fn press_enter() {
// On windows, where installation happens in a console that may have opened just for this
// purpose, give the user an opportunity to see the error before the window closes.
println!();
println!("Press the Enter key to continue.");
use std::io::BufRead;
let stdin = std::io::stdin();
let stdin = stdin.lock();
let mut lines = stdin.lines();
lines.next();
}
#[cfg(not(windows))]
fn press_enter() {}
fn main() {
solana_install::main_init().unwrap_or_else(|err| {
println!("Error: {}", err);
press_enter();
exit(1);
});
press_enter();
}