Skip to content

Commit

Permalink
fix formating
Browse files Browse the repository at this point in the history
  • Loading branch information
Vahegian committed Mar 8, 2022
1 parent 8ea3409 commit aa6394c
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions src/project_creator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,24 @@ fn create_folders(r_path: &str, name: &str) -> Result<(), std::io::Error> {
pub fn create_new_project(r_path: &str, name: &str) -> Result<(), Box<dyn Error>> {
create_folders(r_path, name)?;
create_file_from_web(
&format!("{}/{}/{}", constants::PROJECT_URL, constants::TEMPLATE_DIR, constants::ENTRY_TEMPLATE),
&format!(
"{}/{}/{}",
constants::PROJECT_URL,
constants::TEMPLATE_DIR,
constants::ENTRY_TEMPLATE
),
&format!("{}/{}/{}", r_path, &name, constants::TEMPLATE_DIR),
constants::ENTRY_TEMPLATE,
)?;

create_file_from_web(
&format!("{}/{}/{}/{}", constants::PROJECT_URL, constants::STATIC_DIR, constants::JAVASCRIPT_DIR, constants::JAVASCRIPT_FILE),
&format!(
"{}/{}/{}/{}",
constants::PROJECT_URL,
constants::STATIC_DIR,
constants::JAVASCRIPT_DIR,
constants::JAVASCRIPT_FILE
),
&format!(
"{}/{}/{}/{}",
r_path,
Expand All @@ -63,7 +74,13 @@ pub fn create_new_project(r_path: &str, name: &str) -> Result<(), Box<dyn Error>
)?;

create_file_from_web(
&format!("{}/{}/{}/{}", constants::PROJECT_URL, constants::STATIC_DIR, constants::CSS_DIR, constants::CSS_FILE),
&format!(
"{}/{}/{}/{}",
constants::PROJECT_URL,
constants::STATIC_DIR,
constants::CSS_DIR,
constants::CSS_FILE
),
&format!(
"{}/{}/{}/{}",
r_path,
Expand All @@ -75,7 +92,12 @@ pub fn create_new_project(r_path: &str, name: &str) -> Result<(), Box<dyn Error>
)?;

create_file_from_web(
&format!("{}/{}/{}", constants::PROJECT_URL, constants::STATIC_DIR, constants::IMAGE_FILE),
&format!(
"{}/{}/{}",
constants::PROJECT_URL,
constants::STATIC_DIR,
constants::IMAGE_FILE
),
&format!("{}/{}/{}", r_path, &name, constants::STATIC_DIR),
constants::IMAGE_FILE,
)?;
Expand Down

0 comments on commit aa6394c

Please sign in to comment.