mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-26 09:05:52 +00:00
Make model_path
optional
This commit is contained in:
parent
625ae70140
commit
a9ce688a2c
@ -9,7 +9,7 @@ use serde::Deserialize;
|
|||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub default_path: PathBuf,
|
pub default_path: Option<PathBuf>,
|
||||||
pub default_model: PathBuf,
|
pub default_model: PathBuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ mod window;
|
|||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
|
use std::path::PathBuf;
|
||||||
use std::{collections::HashMap, sync::mpsc, time::Instant};
|
use std::{collections::HashMap, sync::mpsc, time::Instant};
|
||||||
|
|
||||||
use futures::executor::block_on;
|
use futures::executor::block_on;
|
||||||
@ -54,7 +55,7 @@ fn main() -> anyhow::Result<()> {
|
|||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
let config = Config::load()?;
|
let config = Config::load()?;
|
||||||
|
|
||||||
let mut path = config.default_path;
|
let mut path = config.default_path.unwrap_or_else(|| PathBuf::from(""));
|
||||||
path.push(args.model.unwrap_or(config.default_model));
|
path.push(args.model.unwrap_or(config.default_model));
|
||||||
|
|
||||||
let model = Model::from_path(path)?;
|
let model = Model::from_path(path)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user