Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iota-move): fix os error 2 for iota move new command using <NAME> with uppercase letter(s) #4916

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/iota-move/src/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ pub struct New {
impl New {
pub fn execute(self, path: Option<&Path>) -> anyhow::Result<()> {
let name = &self.new.name.to_lowercase();
let provided_name = &self.new.name.to_string();

self.new
.execute(path, [(IOTA_PKG_NAME, IOTA_PKG_PATH)], [(name, "0x0")], "")?;
let p = path.unwrap_or_else(|| Path::new(&name));
let p = path.unwrap_or_else(|| Path::new(&provided_name));
let mut w = std::fs::File::create(
p.join(SourcePackageLayout::Sources.path())
.join(format!("{name}.move")),
Expand Down
4 changes: 2 additions & 2 deletions external-crates/move/crates/move-cli/src/base/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ impl New {

if !Identifier::is_valid(&name) {
return Err(anyhow!(
"Invalid package name. Package name must start with a lowercase letter \
and consist only of lowercase letters, numbers, and underscores."
"Invalid package name. Package name must start with a letter or underscore \
and consist only of letters, numbers, and underscores."
));
}

Expand Down
Loading