From fb556e1932f5327639dc855ad2bd41cc370b66c6 Mon Sep 17 00:00:00 2001 From: Andrea Ricchi Date: Wed, 15 Nov 2023 12:04:15 +0100 Subject: [PATCH] DartToCsv: fix project parsing error Signed-off-by: Andrea Ricchi --- src/dart_to_csv.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dart_to_csv.rs b/src/dart_to_csv.rs index 38a2f3f..a82ceb4 100644 --- a/src/dart_to_csv.rs +++ b/src/dart_to_csv.rs @@ -49,7 +49,7 @@ fn read_file(path: String) -> Vec { result.pop(); } - if translations.contains(&result) { + if !translations.contains(&result) { println!("1.Translation found: {result}"); translations.push(result); } @@ -81,6 +81,10 @@ fn write_file( } pub fn dart_to_csv(path: &String, language: &String) { + if path.is_empty() || language.is_empty() { + return; + } + let mut all_translations = Vec::new(); let project_path = { path }.to_owned() + "/**/*.dart";