From ee934caf3c1726dfa59df83f216d2adca3c89a6b Mon Sep 17 00:00:00 2001 From: DustInDark Date: Thu, 23 Jun 2022 21:16:26 +0900 Subject: [PATCH] adjusted base on execution path case of execution path is not working directory --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 075a486e..d8eab8ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -145,7 +145,10 @@ impl App { .ok(); return; } - + // ワーキングディレクトリ以外からの実行の際にrules-configオプションの指定がないとエラーが発生することを防ぐための処理 + if configs::CONFIG.read().unwrap().args.config.to_str().unwrap() == "./rules/config" { + configs::CONFIG.write().unwrap().args.config = CURRENT_EXE_PATH.join("rules/config"); + } if let Some(csv_path) = &configs::CONFIG.read().unwrap().args.output { let pivot_key_unions = PIVOT_KEYWORD.read().unwrap(); pivot_key_unions.iter().for_each(|(key, _)| {