Skip to content

Commit

Permalink
Use default_path from configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Mar 16, 2022
1 parent 0c3380b commit 71d2587
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ fn main() -> anyhow::Result<()> {

let args = Args::parse();
let config = Config::load()?;
let model = Model::new(args.model.unwrap_or(config.default_model));
let model = Model::new(
config.default_path,
args.model.unwrap_or(config.default_model),
);

let mut parameters = HashMap::new();
for parameter in args.parameters {
Expand Down
4 changes: 2 additions & 2 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pub struct Model {
}

impl Model {
pub fn new(rel_path: PathBuf) -> Self {
let mut path = PathBuf::from("models");
pub fn new(base_path: PathBuf, rel_path: PathBuf) -> Self {
let mut path = base_path;
path.push(rel_path);

Self { path }
Expand Down

0 comments on commit 71d2587

Please sign in to comment.