Add reboot and shell ability in pause

This commit is contained in:
Roey Darwish Dror
2019-06-13 22:05:18 +03:00
parent 79febd78b5
commit a834a79f45
5 changed files with 46 additions and 8 deletions

View File

@@ -8,3 +8,9 @@ pub mod macos;
pub mod unix;
#[cfg(target_os = "windows")]
pub mod windows;
#[cfg(windows)]
pub use windows::reboot;
#[cfg(unix)]
pub use unix::reboot;

View File

@@ -129,3 +129,7 @@ pub fn run_sdkman(base_dirs: &BaseDirs, cleanup: bool, run_type: RunType) -> Res
Ok(())
}
pub fn reboot() {
Command::new("sudo").arg("reboot").spawn().ok();
}

View File

@@ -95,3 +95,7 @@ pub fn run_wsl_topgrade(run_type: RunType) -> Result<(), Error> {
.arg(format!("TOPGRADE_PREFIX=WSL exec {}", topgrade))
.check_run()
}
pub fn reboot() {
Command::new("shutdown").args(&["/R", "/T", "0"]).spawn().ok();
}