From 0a3b3994bb14d354f1d324d9a2c80b77e278f6ce Mon Sep 17 00:00:00 2001
From: Reinaldo Ossuna <reinaldo.ossuna@gmail.com>
Date: Wed, 6 Jul 2022 08:49:49 -0400
Subject: [PATCH 1/2] Fix Doom upgrade command

---
 src/steps/emacs.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/steps/emacs.rs b/src/steps/emacs.rs
index 862ff16d..46bf2566 100644
--- a/src/steps/emacs.rs
+++ b/src/steps/emacs.rs
@@ -67,7 +67,7 @@ impl Emacs {
         print_separator("Doom Emacs");
 
         let mut command = ctx.run_type().execute(doom);
-        command.args(&["-y", "upgrade"]);
+        command.args(&["upgrade"]);
 
         if ctx.config().yes(Step::Emacs) {
             command.arg("--force");

From c3e76fe430ee1fb50e11af4456c4c1716142ed3f Mon Sep 17 00:00:00 2001
From: Reinaldo Ossuna <rossuna@tutanota.com>
Date: Thu, 14 Jul 2022 13:38:00 -0400
Subject: [PATCH 2/2] Check for Doom-Emacs before init-file

---
 src/steps/emacs.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/steps/emacs.rs b/src/steps/emacs.rs
index 46bf2566..9de21a24 100644
--- a/src/steps/emacs.rs
+++ b/src/steps/emacs.rs
@@ -78,14 +78,14 @@ impl Emacs {
 
     pub fn upgrade(&self, ctx: &ExecutionContext) -> Result<()> {
         let emacs = require("emacs")?;
-        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);
         }
 
+        let init_file = require_option(self.directory.as_ref(), String::from("Emacs directory does not exist"))?
+            .join("init.el")
+            .require()?;
+
         print_separator("Emacs");
 
         let mut command = ctx.run_type().execute(&emacs);