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

Release flag #611

Merged
merged 12 commits into from
Feb 8, 2023
5 changes: 4 additions & 1 deletion cargo-shuttle/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ pub struct RunArgs {
#[arg(long, default_value = "8000")]
pub port: u16,
/// use 0.0.0.0 instead of localhost (for usage with local external devices)
#[clap(long)]
#[arg(long)]
pub external: bool,
/// Use release mode for building the project.
#[arg(long, short = 'r')]
pub release: bool,
}

#[derive(Parser, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion cargo-shuttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ impl Shuttle {
"Building".bold().green(),
working_directory.display()
);
let so_path = build_crate(id, working_directory, false, tx).await?;
let so_path = build_crate(id, working_directory, run_args.release, tx).await?;

trace!("loading secrets");
let secrets_path = working_directory.join("Secrets.toml");
Expand Down
6 changes: 5 additions & 1 deletion cargo-shuttle/tests/integration/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ async fn cargo_shuttle_run(working_directory: &str, external: bool) -> String {
format!("http://0.0.0.0:{port}")
};

let run_args = RunArgs { port, external };
let run_args = RunArgs {
port,
external,
release: false,
};

let runner = Shuttle::new().unwrap().run(Args {
api_url: Some("http://shuttle.invalid:80".to_string()),
Expand Down