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: create init project from correct dir #518

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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