committed by
GitHub
parent
7f92b56fa8
commit
0e8926453a
@@ -236,6 +236,7 @@ fn run() -> Result<()> {
|
|||||||
if let Some(directory) = emacs.directory() {
|
if let Some(directory) = emacs.directory() {
|
||||||
git_repos.insert(directory);
|
git_repos.insert(directory);
|
||||||
}
|
}
|
||||||
|
git_repos.insert(base_dirs.home_dir().join(".doom.d"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.should_run(Step::Vim) {
|
if config.should_run(Step::Vim) {
|
||||||
|
|||||||
@@ -5,9 +5,13 @@ use anyhow::Result;
|
|||||||
use directories::BaseDirs;
|
use directories::BaseDirs;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::PathBuf;
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
const EMACS_UPGRADE: &str = include_str!("emacs.el");
|
const EMACS_UPGRADE: &str = include_str!("emacs.el");
|
||||||
|
#[cfg(windows)]
|
||||||
|
const DDOM_PATH: &str = "bin/doom.cmd";
|
||||||
|
#[cfg(unix)]
|
||||||
|
const DDOM_PATH: &str = "bin/doom";
|
||||||
|
|
||||||
pub struct Emacs {
|
pub struct Emacs {
|
||||||
directory: Option<PathBuf>,
|
directory: Option<PathBuf>,
|
||||||
@@ -35,9 +39,20 @@ impl Emacs {
|
|||||||
self.directory.as_ref()
|
self.directory.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn update_doom(doom: &Path, run_type: RunType) -> Result<()> {
|
||||||
|
print_separator("Doom Emacs");
|
||||||
|
|
||||||
|
run_type.execute(doom).arg("upgrade").check_run()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn upgrade(&self, run_type: RunType) -> Result<()> {
|
pub fn upgrade(&self, run_type: RunType) -> Result<()> {
|
||||||
let emacs = require("emacs")?;
|
let emacs = require("emacs")?;
|
||||||
let init_file = require_option(self.directory.as_ref())?.join("init.el").require()?;
|
let init_file = require_option(self.directory.as_ref())?.join("init.el").require()?;
|
||||||
|
let doom = require_option(self.directory.as_ref())?.join(DDOM_PATH);
|
||||||
|
|
||||||
|
if doom.exists() {
|
||||||
|
return Emacs::update_doom(&doom, run_type);
|
||||||
|
}
|
||||||
|
|
||||||
print_separator("Emacs");
|
print_separator("Emacs");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user