Skip to content

Commit

Permalink
Add a default .move file creation feature to the rooch move new comma…
Browse files Browse the repository at this point in the history
…nd (#3056)
  • Loading branch information
baicaiyihao authored Dec 18, 2024
1 parent a3e5e04 commit 13e2669
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions third_party/move/language/tools/move-cli/src/base/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ impl New {
None => Path::new(&name),
};
create_dir_all(path.join(SourcePackageLayout::Sources.path()))?;
let mut source_file = std::fs::File::create(
path.join(SourcePackageLayout::Sources.path())
.join(format!("{name}.move")),
)?;
writeln!(
&mut source_file,
r#"/*
/// Module: {name}
module {name}::{name} {{
}}
*/"#,
name = name
)?;
let mut w = std::fs::File::create(path.join(SourcePackageLayout::Manifest.path()))?;
writeln!(
&mut w,
Expand Down

0 comments on commit 13e2669

Please sign in to comment.