Skip to content
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
14 changes: 7 additions & 7 deletions crates/terminal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,32 @@ macro_rules! einfo {

#[macro_export]
macro_rules! cprint {
($color:expr, $($arg:tt)*) => {
($color:expr, $($arg:tt)*) => {{
use std::io::Write;
let mut out = $crate::ColorText::stdout($color);
let _ = write!(out, $($arg)*);
drop(out); // Reset colors
};
}};
}

#[macro_export]
macro_rules! ceprint {
($color:expr, $($arg:tt)*) => {
($color:expr, $($arg:tt)*) => {{
use std::io::Write;
let mut out = $crate::ColorText::stderr($color);
let _ = write!(out, $($arg)*);
drop(out); // Reset colors
};
drop(out); // Reset color}s
}};
}

#[macro_export]
macro_rules! ceprintln {
($color:expr, $($arg:tt)*) => {
($color:expr, $($arg:tt)*) => {{
use std::io::Write;
let mut out = $crate::ColorText::stderr($color);
let _ = writeln!(out, $($arg)*);
drop(out); // Reset colors
};
}};
}

pub mod colors {
Expand Down
14 changes: 13 additions & 1 deletion src/commands/cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,19 @@ fn deployment_plugin(cmd: &str) -> anyhow::Result<String> {
match std::env::var(DEPLOY_PLUGIN_ENV) {
Ok(v) => Ok(v),
Err(std::env::VarError::NotPresent) => {
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.");
terminal::ceprintln!(terminal::colors::bold_red(), "******** IMPORTANT! ********");
terminal::ceprint!(terminal::colors::bold_red(), "Future breaking change: ");
eprintln!("`spin {cmd}` needs to be told which deployment plugin to use. Either:");
terminal::step!(
"*",
"Run a plugin command (e.g. `spin {DEFAULT_DEPLOY_PLUGIN} {cmd}`); or"
);
terminal::step!("*", "Set the `{DEPLOY_PLUGIN_ENV}` environment variable.");
eprintln!("For now, Spin will default to the `{DEFAULT_DEPLOY_PLUGIN}` plugin.");
terminal::ceprintln!(
terminal::colors::bold_red(),
"This will be a hard error in a future version."
);
Ok(DEFAULT_DEPLOY_PLUGIN.to_string())
}
Err(_) => anyhow::bail!("{DEPLOY_PLUGIN_ENV} was defined but its value could not be read"),
Expand Down
Loading