Skip to content

Commit

Permalink
move normalization to main
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Jan 27, 2023
1 parent fc17b63 commit ebc092d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use glob::glob;
use serde::{Deserialize, Deserializer};
use std::{fs, path::PathBuf, sync::Arc};

use crate::{url::UrlPath, normalize::Normalize};
use crate::url::UrlPath;

fn parse_template<'de, D>(deserializer: D) -> Result<Arc<String>, D::Error>
where
Expand Down Expand Up @@ -161,8 +161,8 @@ impl Config {
)
.map_err(|e| format!("Unable to parse config: {e}"))?;

config.input_dir = input_dir.normalize();
config.output_dir = output_dir.normalize();
config.input_dir = input_dir;
config.output_dir = output_dir;
config.output_url = output_url;
Ok(Arc::from(config))
}
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![feature(result_option_inspect)]
#![feature(iter_advance_by)]

use crate::{analyze::create_docs, url::UrlPath};
use crate::{analyze::create_docs, url::UrlPath, normalize::Normalize};
use clap::Parser;
use config::Config;
use std::{fs, path::{PathBuf, Path}, process::exit, io};
Expand Down Expand Up @@ -84,12 +84,12 @@ async fn main() -> Result<(), String> {
let full_output = if args.output.is_absolute() {
args.output
} else {
std::env::current_dir().unwrap().join(args.output)
std::env::current_dir().unwrap().join(args.output).normalize()
};
let full_input = if args.input.is_absolute() {
args.input
} else {
std::env::current_dir().unwrap().join(args.input)
std::env::current_dir().unwrap().join(args.input).normalize()
};
std::env::set_current_dir(&full_input).expect(
"Unable to set input dir as working directory \
Expand Down

0 comments on commit ebc092d

Please sign in to comment.