From 1809258cdd2deaa19058e3d68afbb72b3c0d1eb4 Mon Sep 17 00:00:00 2001 From: Ryan Brue Date: Mon, 9 Sep 2024 13:33:19 -0500 Subject: [PATCH] fix: regression with output_path arg Signed-off-by: Ryan Brue --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a85a2a..34dc660 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,7 +331,7 @@ dependencies = [ [[package]] name = "simple-ssg" -version = "4.0.0" +version = "4.0.1" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index ec7b7d0..1f29a43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ authors = ["Ryan Brue "] repository = "https://github.com/ryanabx/simple-ssg" license = "MIT" readme = "README.md" -version = "4.0.0" +version = "4.0.1" edition = "2021" description = "Plain and simple static site generator for Djot and Markdown light markup languages" diff --git a/src/main.rs b/src/main.rs index 459ae0f..dd22636 100644 --- a/src/main.rs +++ b/src/main.rs @@ -63,12 +63,16 @@ fn run_program(args: ConsoleArgs) -> anyhow::Result<()> { dir.display() )); } - (dir, env::current_dir()?.join("output")) + ( + dir, + args.output_path + .unwrap_or(env::current_dir()?.join("output")), + ) } else if let Some(path) = args.file { if path.is_dir() { return Err(anyhow!("Path {} is a directory. Specify without the -f positional argument if this was intended.", path.display())); } - (path, env::current_dir()?) + (path, args.output_path.unwrap_or(env::current_dir()?)) } else { return Err(anyhow!( "Must specify either a directory or a path with -f "