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

fix(cargo-shuttle): don't print platform info in unrelated commands #1902

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cargo-shuttle/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-shuttle"
version = "0.48.2"
version = "0.48.3"
edition.workspace = true
license.workspace = true
repository.workspace = true
Expand Down
13 changes: 9 additions & 4 deletions cargo-shuttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,15 @@ impl Shuttle {
bail!("This command is not supported on the OLD platform (shuttle.rs).");
}

if self.beta {
eprintln!("{}", "INFO: Using NEW platform API (shuttle.dev)".green());
} else {
eprintln!("{}", "INFO: Using OLD platform API (shuttle.rs)".blue());
if !matches!(
args.cmd,
Command::Feedback | Command::Generate(_) | Command::Upgrade { .. }
) {
Comment on lines +184 to +187
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider using a constant or enum for these command types to improve maintainability

if self.beta {
eprintln!("{}", "INFO: Using NEW platform API (shuttle.dev)".green());
} else {
eprintln!("{}", "INFO: Using OLD platform API (shuttle.rs)".blue());
}
}
if let Some(ref url) = args.api_url {
if (!self.beta && url != API_URL_DEFAULT) || (self.beta && url != API_URL_BETA) {
Expand Down