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

feat: use cargo generate instead of hardcoding examples source code #888

Merged
merged 14 commits into from
Jun 9, 2023
Merged
Prev Previous commit
Next Next commit
use project name .as_ref()
  • Loading branch information
paulotten committed Jun 7, 2023
commit bdb621298fa8dff75e5ffbbdcde14be633c395a3
2 changes: 1 addition & 1 deletion cargo-shuttle/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl ShuttleInit for ShuttleInitNoOp {
}
}

pub fn cargo_generate(path: PathBuf, name: ProjectName, framework: Template) -> Result<()> {
pub fn cargo_generate(path: PathBuf, name: &ProjectName, framework: Template) -> Result<()> {
let config = framework.init_config();

println!(r#" Creating project "{name}" in {path:?}"#);
Expand Down
9 changes: 8 additions & 1 deletion cargo-shuttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,14 @@ impl Shuttle {
};

// 5. Initialize locally
init::cargo_generate(path.clone(), project_args.name.clone().unwrap(), framework)?;
init::cargo_generate(
path.clone(),
project_args
.name
.as_ref()
.expect("to have a project name provided"),
framework,
)?;
println!();

// 6. Confirm that the user wants to create the project environment on Shuttle
Expand Down