Fix doom emacs upgrading (fix #961) (#13)

Authored-by: Rotem Yaari <vmalloc@gmail.com>
Approved-by: Thomas Schönauer <t.schoenauer@hgs-wt.at>
This commit is contained in:
DottoDev
2022-10-10 20:26:20 +00:00
committed by GitHub
parent a9d5d24a35
commit f063afe536

View File

@@ -67,25 +67,24 @@ impl Emacs {
print_separator("Doom Emacs");
let mut command = ctx.run_type().execute(doom);
command.args(&["-y", "upgrade"]);
if ctx.config().yes(Step::Emacs) {
command.arg("--force");
}
command.args(&["upgrade"]);
command.check_run()
}
pub fn upgrade(&self, ctx: &ExecutionContext) -> Result<()> {
let emacs = require("emacs")?;
if let Some(doom) = &self.doom {
Emacs::update_doom(doom, ctx)?;
}
let init_file = require_option(self.directory.as_ref(), String::from("Emacs directory does not exist"))?
.join("init.el")
.require()?;
if let Some(doom) = &self.doom {
return Emacs::update_doom(doom, ctx);
}
print_separator("Emacs");
let mut command = ctx.run_type().execute(&emacs);