Implement --no-emacs (fixes #61)
This commit is contained in:
22
src/main.rs
22
src/main.rs
@@ -92,6 +92,11 @@ fn run() -> Result<(), Error> {
|
|||||||
.help("Don't perform updates on configured git repos")
|
.help("Don't perform updates on configured git repos")
|
||||||
.long("no-git-repos"),
|
.long("no-git-repos"),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("no_emacs")
|
||||||
|
.help("Don't upgrade Emacs packages or configuration files")
|
||||||
|
.long("no-emacs"),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("dry_run")
|
Arg::with_name("dry_run")
|
||||||
.help("Print what would be done")
|
.help("Print what would be done")
|
||||||
@@ -153,7 +158,10 @@ fn run() -> Result<(), Error> {
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
report.push_result(execute(|terminal| unix::run_homebrew(terminal, dry_run), &mut terminal));
|
report.push_result(execute(|terminal| unix::run_homebrew(terminal, dry_run), &mut terminal));
|
||||||
|
|
||||||
git_repos.insert(base_dirs.home_dir().join(".emacs.d"));
|
if !(matches.is_present("no_emacs")) {
|
||||||
|
git_repos.insert(base_dirs.home_dir().join(".emacs.d"));
|
||||||
|
}
|
||||||
|
|
||||||
git_repos.insert(base_dirs.home_dir().join(".vim"));
|
git_repos.insert(base_dirs.home_dir().join(".vim"));
|
||||||
git_repos.insert(base_dirs.home_dir().join(".config/nvim"));
|
git_repos.insert(base_dirs.home_dir().join(".config/nvim"));
|
||||||
|
|
||||||
@@ -208,10 +216,14 @@ fn run() -> Result<(), Error> {
|
|||||||
|terminal| generic::run_cargo_update(&base_dirs, terminal, dry_run),
|
|terminal| generic::run_cargo_update(&base_dirs, terminal, dry_run),
|
||||||
&mut terminal,
|
&mut terminal,
|
||||||
));
|
));
|
||||||
report.push_result(execute(
|
|
||||||
|terminal| generic::run_emacs(&base_dirs, terminal, dry_run),
|
if !(matches.is_present("no_git_repos")) {
|
||||||
&mut terminal,
|
report.push_result(execute(
|
||||||
));
|
|terminal| generic::run_emacs(&base_dirs, terminal, dry_run),
|
||||||
|
&mut terminal,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
report.push_result(execute(
|
report.push_result(execute(
|
||||||
|terminal| generic::run_opam_update(terminal, dry_run),
|
|terminal| generic::run_opam_update(terminal, dry_run),
|
||||||
&mut terminal,
|
&mut terminal,
|
||||||
|
|||||||
Reference in New Issue
Block a user