Skip to content

Commit

Permalink
do not create empty source code file (#15079)
Browse files Browse the repository at this point in the history
Co-authored-by: Zekun Wang <[email protected]>
  • Loading branch information
fEst1ck and Zekun Wang authored Oct 29, 2024
1 parent d50e048 commit f05afc2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/aptos/src/move_tool/stored_package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,15 @@ impl<'a> CachedPackageMetadata<'a> {
let sources_dir = path.join(CompiledPackageLayout::Sources.path());
fs::create_dir_all(&sources_dir)?;
for module in &self.metadata.modules {
let source = match module.source.is_empty() {
match module.source.is_empty() {
true => {
println!("module without code: {}", module.name);
"".into()
},
false => unzip_metadata_str(&module.source)?,
false => {
let source = unzip_metadata_str(&module.source)?;
fs::write(sources_dir.join(format!("{}.move", module.name)), source)?;
},
};
fs::write(sources_dir.join(format!("{}.move", module.name)), source)?;
}
Ok(())
}
Expand Down

0 comments on commit f05afc2

Please sign in to comment.