This commit is contained in:
Roey Darwish Dror
2018-05-31 16:17:28 +03:00
parent 793d41c2a5
commit b2d7367c8f

View File

@@ -48,6 +48,11 @@ impl Chain for ExitStatus {
}
}
const EMACS_UPGRADE: &str = "(progn (let ((package-menu-async nil))
(package-list-packages))
(package-menu-mark-upgrades)
(package-menu-execute 'noquery))";
fn home_path(p: &str) -> PathBuf {
let mut path = home_dir().unwrap();
path.push(p);
@@ -119,6 +124,18 @@ fn run() -> Result<()> {
.wait()?;
}
if let Ok(emacs) = which("emacs") {
terminal.print_separator("Emacs");
if home_path(".emacs.d").exists() {
Command::new(&emacs)
.arg("--batch")
.arg("--eval")
.arg(EMACS_UPGRADE)
.spawn()?
.wait()?;
}
}
if cfg!(target_os = "linux") {
let sudo = which("sudo");