Skip to content

Commit

Permalink
feat: create init project from correct dir (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
oddgrd authored Dec 9, 2022
1 parent a37903a commit 519ac04
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cargo-shuttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Shuttle {

// 5. Initialize locally
init::cargo_init(path.clone())?;
init::cargo_shuttle_init(path, framework)?;
init::cargo_shuttle_init(path.clone(), framework)?;
println!();

// 6. Confirm that the user wants to create the project environment on Shuttle
Expand All @@ -182,12 +182,20 @@ impl Shuttle {
} else if args.new {
true
} else {
Confirm::with_theme(&theme)
let should_create = Confirm::with_theme(&theme)
.with_prompt("Do you want to create the project environment on Shuttle?")
.default(true)
.interact()?
.interact()?;

println!();
should_create
};

if should_create_environment {
// Set the project working directory path to the init path,
// so `load_project` is ran with the correct project path
project_args.working_directory = path;

self.load_project(&mut project_args)?;
let mut client = Client::new(self.ctx.api_url());
client.set_api_key(self.ctx.api_key()?);
Expand Down

0 comments on commit 519ac04

Please sign in to comment.