From fff7c4ef32fcd0a875eb7d96bc2f774aad51a908 Mon Sep 17 00:00:00 2001 From: ControlCplusControlV <44706811+ControlCplusControlV@users.noreply.github.com> Date: Thu, 3 Mar 2022 18:35:29 -0700 Subject: [PATCH] Fix Project Manifest File Names (#871) * Fix Project Manifest File Names * fmt * One clippy thing --- forc/src/ops/forc_init.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/forc/src/ops/forc_init.rs b/forc/src/ops/forc_init.rs index 741a539c092..3f7cd26aa62 100644 --- a/forc/src/ops/forc_init.rs +++ b/forc/src/ops/forc_init.rs @@ -4,6 +4,8 @@ use std::fs; use sway_utils::constants; pub(crate) fn init_new_project(project_name: String) -> Result<()> { + let neat_name: String = project_name.split('/').last().unwrap().to_string(); + // Make a new directory for the project fs::create_dir_all(format!("{}/src", project_name))?; @@ -13,13 +15,13 @@ pub(crate) fn init_new_project(project_name: String) -> Result<()> { // Insert default manifest file fs::write( format!("{}/{}", project_name, constants::MANIFEST_FILE_NAME), - defaults::default_manifest(&project_name), + defaults::default_manifest(&neat_name), )?; // Insert default test manifest file fs::write( format!("{}/{}", project_name, constants::TEST_MANIFEST_FILE_NAME), - defaults::default_tests_manifest(&project_name), + defaults::default_tests_manifest(&neat_name), )?; // Insert default main function