fix root; fix directory creation
This commit is contained in:
@@ -52,7 +52,7 @@ Subsequently running the program will check for updates and download any new epi
|
|||||||
To sync podcasts to a Rockbox iPod, simply run
|
To sync podcasts to a Rockbox iPod, simply run
|
||||||
|
|
||||||
```
|
```
|
||||||
podcast-hoarder <ipod-root>
|
podcast-hoarder sync <ipod-root>
|
||||||
```
|
```
|
||||||
|
|
||||||
replacing `<ipod-root>` with the root directory of the iPod. This will generate playlists for all podcasts, sync the playlists to the iPod, and sync the episodes to the iPod.
|
replacing `<ipod-root>` with the root directory of the iPod. This will generate playlists for all podcasts, sync the playlists to the iPod, and sync the episodes to the iPod.
|
||||||
|
|||||||
@@ -162,7 +162,10 @@ pub(crate) fn sync(
|
|||||||
|
|
||||||
if !target.exists() {
|
if !target.exists() {
|
||||||
println!("[info] copying from {:?} to {:?}.", source, target);
|
println!("[info] copying from {:?} to {:?}.", source, target);
|
||||||
fs::create_dir_all(target.parent().unwrap())?;
|
let parent = target.parent().unwrap();
|
||||||
|
if !parent.exists() {
|
||||||
|
fs::create_dir_all(parent)?;
|
||||||
|
}
|
||||||
fs::copy(source, target)?;
|
fs::copy(source, target)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user