Browse Source

Create parent directory only

master
Thomas Forgione 1 year ago
parent
commit
5172e2cb57
No known key found for this signature in database GPG Key ID: 203DAEA747F48F41
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/git.rs

+ 4
- 1
src/git.rs View File

@@ -92,7 +92,10 @@ fn clone_dirty<P: AsRef<Path>>(url: &str, place: P) -> Result<()> {
return Err(Error::PathAlreadyExists);
}

create_dir_all(place)?;
// Need to create the parent dir only if it exists
if let Some(parent) = place.parent() {
create_dir_all(parent)?;
}

let command = Command::new("git")
.args(&["clone", &url, &place.display().to_string()])


Loading…
Cancel
Save