A simple CPU rendered GUI IDE experience.
canonicalized
| -rw-r--r-- | src/edi.rs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -201,7 +201,15 @@ impl Editor { let mut o = std::env::args() .nth(1) .and_then(|x| PathBuf::try_from(x).ok()) - .and_then(|x| x.canonicalize().ok()) + .and_then(|x| { + x.canonicalize() + .inspect_err(|_| { + _ = std::fs::File::create(&x); + }) + .ok() + .or_else(|| x.canonicalize().ok()) + .or(Some(x)) + }) .or_else(|| { rfd::FileDialog::new() .set_can_create_directories(true) |