Skip to content

Commit 2faa69b

Browse files
authored
Merge pull request #3299 from itowlson/shouty-time-for-spin-deploy
Make `spin deploy` breaking change warning more emphatic
2 parents ceaed3a + 9a79314 commit 2faa69b

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

crates/terminal/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,32 +110,32 @@ macro_rules! einfo {
110110

111111
#[macro_export]
112112
macro_rules! cprint {
113-
($color:expr, $($arg:tt)*) => {
113+
($color:expr, $($arg:tt)*) => {{
114114
use std::io::Write;
115115
let mut out = $crate::ColorText::stdout($color);
116116
let _ = write!(out, $($arg)*);
117117
drop(out); // Reset colors
118-
};
118+
}};
119119
}
120120

121121
#[macro_export]
122122
macro_rules! ceprint {
123-
($color:expr, $($arg:tt)*) => {
123+
($color:expr, $($arg:tt)*) => {{
124124
use std::io::Write;
125125
let mut out = $crate::ColorText::stderr($color);
126126
let _ = write!(out, $($arg)*);
127-
drop(out); // Reset colors
128-
};
127+
drop(out); // Reset color}s
128+
}};
129129
}
130130

131131
#[macro_export]
132132
macro_rules! ceprintln {
133-
($color:expr, $($arg:tt)*) => {
133+
($color:expr, $($arg:tt)*) => {{
134134
use std::io::Write;
135135
let mut out = $crate::ColorText::stderr($color);
136136
let _ = writeln!(out, $($arg)*);
137137
drop(out); // Reset colors
138-
};
138+
}};
139139
}
140140

141141
pub mod colors {

src/commands/cloud.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,19 @@ fn deployment_plugin(cmd: &str) -> anyhow::Result<String> {
6060
match std::env::var(DEPLOY_PLUGIN_ENV) {
6161
Ok(v) => Ok(v),
6262
Err(std::env::VarError::NotPresent) => {
63-
terminal::warn!("`spin {cmd}` will soon need to be told which deployment plugin to use.\nRun a plugin command (e.g. `spin {DEFAULT_DEPLOY_PLUGIN} {cmd}`), or set the `{DEPLOY_PLUGIN_ENV}` environment variable, instead.\nDefaulting to `{DEFAULT_DEPLOY_PLUGIN}` plugin.");
63+
terminal::ceprintln!(terminal::colors::bold_red(), "******** IMPORTANT! ********");
64+
terminal::ceprint!(terminal::colors::bold_red(), "Future breaking change: ");
65+
eprintln!("`spin {cmd}` needs to be told which deployment plugin to use. Either:");
66+
terminal::step!(
67+
"*",
68+
"Run a plugin command (e.g. `spin {DEFAULT_DEPLOY_PLUGIN} {cmd}`); or"
69+
);
70+
terminal::step!("*", "Set the `{DEPLOY_PLUGIN_ENV}` environment variable.");
71+
eprintln!("For now, Spin will default to the `{DEFAULT_DEPLOY_PLUGIN}` plugin.");
72+
terminal::ceprintln!(
73+
terminal::colors::bold_red(),
74+
"This will be a hard error in a future version."
75+
);
6476
Ok(DEFAULT_DEPLOY_PLUGIN.to_string())
6577
}
6678
Err(_) => anyhow::bail!("{DEPLOY_PLUGIN_ENV} was defined but its value could not be read"),

0 commit comments

Comments
 (0)