Skip to content

Commit

Permalink
Allow downgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoh committed Dec 13, 2023
1 parent 57c3d63 commit 4c37283
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
*/

use crate::fs::Fs;
use anyhow::{anyhow, bail, Context};
use anyhow::{anyhow, Context};
use clap::Parser;
use once_cell::sync::Lazy;
use regex::Regex;
use smithy_rs_tool_common::package::PackageStability;
use std::borrow::Cow;
use std::path::{Path, PathBuf};
use tracing::warn;

static STABLE_VERSION_REGEX: Lazy<Regex> = Lazy::new(|| {
Regex::new(
Expand Down Expand Up @@ -104,7 +105,8 @@ fn update_gradle_properties<'a>(
// Special version tag used on the `main` branch
&& current_version != semver::Version::parse("0.0.0-smithy-rs-head").unwrap()
{
bail!("Moving from {current_version} to {upgraded_version} would be a *downgrade*. This command doesn't allow it!");
// NOTE: do not backport this change to mainline during merge.
warn!("Moving from {current_version} to {upgraded_version} is a *downgrade*.");
}
Ok(version_regex.replace(gradle_properties, format!("${{field}}{}", upgraded_version)))
}
Expand Down

0 comments on commit 4c37283

Please sign in to comment.