Skip to content

Commit

Permalink
fix(cargo-miden): force new project name to not be kebab-cased
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat committed Jul 26, 2024
1 parent eb4a3a3 commit 0e82c14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions tools/cargo-miden/src/new_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,21 @@ impl NewCommand {
},
};

let destination = self
.path
.parent()
.map(|p| {
use path_absolutize::Absolutize;
p.absolutize().map(|p| p.to_path_buf())
})
.transpose()
.context("Failed to convert destination path to an absolute path")?;
let generate_args = GenerateArgs {
template_path,
destination: self
.path
.parent()
.map(|p| {
use path_absolutize::Absolutize;
p.absolutize().map(|p| p.to_path_buf())
})
.transpose()
.context("Failed to convert destination path to an absolute path")?,
destination,
name: Some(name),
// Force the `name` to not be kebab-cased
force: true,
force_git_init: true,
verbose: true,
define,
Expand Down
2 changes: 1 addition & 1 deletion tools/cargo-miden/tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn build_new_project_from_template() {
let restore_dir = env::current_dir().unwrap();
let temp_dir = env::temp_dir();
env::set_current_dir(&temp_dir).unwrap();
let project_name = "test-proj";
let project_name = "test_proj_underscore";
let expected_new_project_dir = &temp_dir.join(project_name);
dbg!(&expected_new_project_dir);
if expected_new_project_dir.exists() {
Expand Down

0 comments on commit 0e82c14

Please sign in to comment.