flipperzero-rs / flipperzero

Rust on the Flipper Zero
MIT License
499 stars 32 forks source link

tools/storage: Create directory before sending file #61

Closed mogenson closed 1 year ago

mogenson commented 1 year ago

The build-examples.py --install script would fail on my Flipper with: "ERROR: file/dir not exist" because there was no Examples directory.

Make a small change to storage.rs to get the parent path on the Flipper SD card for the file to send, and create that directory before sending the file.

Converting between FlipperPaths and Paths or PathBufs is a pain, so just split from the last "/" character to get the parent path.

dcoles commented 1 year ago

Thanks for the PR! Much appreciated.