From 9da0449682cfb8bd8da93f24953f2fd8e0437ce9 Mon Sep 17 00:00:00 2001 From: Tyler K <18091407+ambiguousname@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:11:33 -0800 Subject: [PATCH] Fix default path bug --- example/{ => src}/config.toml | 0 feature_tests/{ => src}/config.toml | 0 tool/src/config.rs | 2 +- tool/src/main.rs | 4 +++- 4 files changed, 4 insertions(+), 2 deletions(-) rename example/{ => src}/config.toml (100%) rename feature_tests/{ => src}/config.toml (100%) diff --git a/example/config.toml b/example/src/config.toml similarity index 100% rename from example/config.toml rename to example/src/config.toml diff --git a/feature_tests/config.toml b/feature_tests/src/config.toml similarity index 100% rename from feature_tests/config.toml rename to feature_tests/src/config.toml diff --git a/tool/src/config.rs b/tool/src/config.rs index 786189ef4..3b862050e 100644 --- a/tool/src/config.rs +++ b/tool/src/config.rs @@ -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")] diff --git a/tool/src/main.rs b/tool/src/main.rs index ab9c60fce..78e5a4d3d 100644 --- a/tool/src/main.rs +++ b/tool/src/main.rs @@ -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)?;