Skip to content

Commit

Permalink
fix: regression with output_path arg
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Brue <[email protected]>
  • Loading branch information
ryanabx committed Sep 9, 2024
1 parent e3a48ca commit 1809258
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["Ryan Brue <[email protected]>"]
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"

Expand Down
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <DIRECTORY> 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 <DIRECTORY> or a path with -f <PATH>"
Expand Down

0 comments on commit 1809258

Please sign in to comment.