Skip to content

Commit

Permalink
Fix Project Manifest File Names (FuelLabs#871)
Browse files Browse the repository at this point in the history
* Fix Project Manifest File Names

* fmt

* One clippy thing
  • Loading branch information
ControlCplusControlV authored Mar 4, 2022
1 parent df01d1d commit fff7c4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions forc/src/ops/forc_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))?;

Expand All @@ -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
Expand Down

0 comments on commit fff7c4e

Please sign in to comment.