forked from StrafesNET/map-tool
panic lol
This commit is contained in:
parent
e0e8744bfd
commit
cad29af4bb
@ -270,7 +270,6 @@ enum Interactive{
|
||||
Passed,
|
||||
Blocked,
|
||||
Flagged,
|
||||
ReplaceFailed,
|
||||
}
|
||||
enum ScriptAction {
|
||||
Pass,
|
||||
@ -387,8 +386,7 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
|
||||
println!("replaced source id={} location={}",replace_id,location);
|
||||
replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone()));
|
||||
}else{
|
||||
println!("failed to get replacement source id={} location={}",replace_id,location);
|
||||
fail_type=Interactive::ReplaceFailed;
|
||||
panic!("failed to get replacement source id={} location={}",replace_id,location);
|
||||
}
|
||||
}
|
||||
ScriptAction::Flag => {
|
||||
@ -403,13 +401,14 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
|
||||
}
|
||||
},
|
||||
}
|
||||
}else{
|
||||
panic!("script source property is none!");
|
||||
}
|
||||
}
|
||||
let mut dest=match fail_type{
|
||||
Interactive::Passed => std::path::PathBuf::from("maps/processed"),//write map into maps/processed
|
||||
Interactive::Blocked => std::path::PathBuf::from("maps/blocked"),//write map into maps/blocked
|
||||
Interactive::Flagged => std::path::PathBuf::from("maps/flagged"),//write map into maps/flagged
|
||||
Interactive::ReplaceFailed => continue,//do nothing, map is still unprocessed
|
||||
};
|
||||
dest.push(file_thing.file_name());
|
||||
std::fs::rename(file_thing.path(), dest)?;
|
||||
|
Loading…
Reference in New Issue
Block a user