Skip to content

Commit

Permalink
Fix default path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ambiguousname committed Feb 4, 2025
1 parent a808ec4 commit 9da0449
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tool/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize};

use crate::{demo_gen::DemoConfig, kotlin::KotlinConfig};

#[derive(Clone, Default, Serialize, Deserialize)]
#[derive(Clone, Default, Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Config {
#[serde(rename="kotlin")]
Expand Down
4 changes: 3 additions & 1 deletion tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ fn main() -> std::io::Result<()> {
let opt = Opt::parse();

// -- Config Parsing --
let default_pth = opt.entry.join("config.toml");

// We assume by default that this is located in the directory with all other source files:
let default_pth = opt.entry.join("../config.toml");
let path = opt.config_file.as_deref().unwrap_or(&default_pth);
let config : Config = if path.exists() {
let file_buf = std::fs::read(path)?;
Expand Down

0 comments on commit 9da0449

Please sign in to comment.