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

cargo shuttle init does not handle directory argument properly #671

Closed
wants to merge 9 commits into from
Closed
21 changes: 15 additions & 6 deletions cargo-shuttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,21 @@ impl Shuttle {

// 3. Confirm the project directory
let path = if interactive {
println!("Where should we create this project?");
let directory_str: String = Input::with_theme(&theme)
.with_prompt("Directory")
.default(".".to_owned())
.interact()?;
println!();
let directory_str: String;
if project_args.working_directory.as_os_str().is_empty() {
println!("Where should we create this project?");
directory_str = Input::with_theme(&theme)
.with_prompt("Directory")
.default(".".to_owned())
.interact()?;
println!();
} else {
directory_str = project_args
.working_directory
.into_os_string()
.into_string()
.unwrap();
}
oddgrd marked this conversation as resolved.
Show resolved Hide resolved
args::parse_init_path(OsString::from(directory_str))?
} else {
args.path.clone()
Expand Down