Skip to content

Commit

Permalink
🐛 Corrected REGEX blocking ASR clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
laxentis committed Feb 26, 2023
1 parent b6654db commit 0310446
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 16 additions & 8 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
[
{
"fir": "EPWW",
"package_name": "Sector_AIRAC_Update",
"es_path": "C:\\Users\\dawid\\Documents\\EuroScope",
"asr_path": "EPWW\\ASR",
"navdata_path": "EPWW\\NavData",
"prf_prefix": "Poland "
},
{
"fir": "EURO",
"package_name": "EUROE/Update-Package",
"es_path": "C:\\Users\\dawid\\Documents\\EuroScope",
"asr_path": "EUROE\\ASR",
"navdata_path": "EUROE\\NavData",
"prf_prefix": "EURE"
},
{
"fir": "EXCXO",
"package_name": "EXCXO-Install",
"es_path": "C:\\Users\\dawid\\Documents\\EuroScope",
"asr_path": "EXCXO\\ASR",
"navdata_path": "EXCXO\\NavData",
"prf_prefix": "EXCXO"
},
{
"fir": "EPWW",
"package_name": "Sector_AIRAC_Update",
"es_path": "C:\\Users\\dawid\\Documents\\EuroScope",
"asr_path": "EPWW\\ASR",
"navdata_path": "EPWW\\NavData",
"prf_prefix": "Poland "
}
]
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ async fn change_prf_sectors(

async fn clear_asr(asr_path: PathBuf) -> Result<(), Box<dyn std::error::Error>> {
println!("Clearing ASRs");
let asr_regex = Regex::new(r"SECTORFILE:.*\nSECTORTITLE:.\n").unwrap();
let asr_regex = Regex::new(r"SECTORFILE:.*\nSECTORTITLE:.*\n").unwrap();
for entry in fs::read_dir(asr_path)? {
let entry = entry?;
let fname = entry.file_name().to_str().unwrap().to_owned();
Expand Down

0 comments on commit 0310446

Please sign in to comment.