fix: Parent folders are now automatically created when exporting artifacts

This commit is contained in:
Tim-Paik 2022-05-01 13:58:32 +08:00
parent a5fe6d8ea9
commit 9117dc841f
Signed by: Tim-Paik
GPG Key ID: DC36A050DB42566D
1 changed files with 1 additions and 0 deletions

View File

@ -30,6 +30,7 @@ pub fn bundle(config_path: String) -> std::io::Result<()> {
Some(path) => data::normalize_path(&path.join(&config.target)),
None => data::normalize_path(&config.target),
};
fs::create_dir_all(target.parent().unwrap_or_else(|| std::path::Path::new("/")))?;
let target = if target.extension() == None && cfg!(windows) {
target.with_extension("exe")
} else {