Add reboot and shell ability in pause
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user