Merge pull request #861 from AleoHQ/windows-zip-fix

[CLI] Fixes issue with `leo publish` on Windows
This commit is contained in:
Collin Chin 2021-04-13 17:32:19 -07:00 committed by GitHub
commit b6c5f4d60f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,8 @@ impl ZipFile {
// Write file or directory
if path.is_file() {
tracing::info!("Adding file {:?} as {:?}", path, name);
zip.start_file(name.to_string_lossy(), options)?;
#[allow(deprecated)]
zip.start_file_from_path(name, options)?;
let mut f = File::open(path)?;
f.read_to_end(&mut buffer)?;
@ -116,7 +117,8 @@ impl ZipFile {
// Only if not root Avoids path spec / warning
// and mapname conversion failed error on unzip
tracing::info!("Adding directory {:?} as {:?}", path, name);
zip.add_directory(name.to_string_lossy(), options)?;
#[allow(deprecated)]
zip.add_directory_from_path(name, options)?;
}
}