Skip to content

Commit ad1bd58

Browse files
authored
tools/upgrade-version works properly on Windows (#3232)
# Description of Changes Fixed how the multi-line regexps worked on Windows (with `\r\n` line endings). # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing - [x] `cargo run -- 1.4.1` works properly on Linux still - [x] Applying the same diff and running on Windows, now updates the license files properly. Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
1 parent df82bd8 commit ad1bd58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/upgrade-version/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use std::path::PathBuf;
1212
fn process_license_file(path: &str, version: &str) {
1313
let file = fs::read_to_string(path).unwrap();
1414

15-
let version_re = Regex::new(r"(?m)^(Licensed Work:\s+SpacetimeDB )([\d\.]+)$").unwrap();
15+
let version_re = Regex::new(r"(?m)^(Licensed Work:\s+SpacetimeDB )([\d\.]+)\r?$").unwrap();
1616
let file = version_re.replace_all(&file, |caps: &regex::Captures| format!("{}{}", &caps[1], version));
1717

18-
let date_re = Regex::new(r"(?m)^Change Date:\s+\d{4}-\d{2}-\d{2}$").unwrap();
18+
let date_re = Regex::new(r"(?m)^Change Date:\s+\d{4}-\d{2}-\d{2}\r?$").unwrap();
1919
let new_date = Local::now()
2020
.with_year(Local::now().year() + 5)
2121
.unwrap()

0 commit comments

Comments
 (0)