Skip to content

Commit

Permalink
fix: Update age config itself
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Mar 21, 2024
1 parent 4ef6687 commit 732f1cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub fn update(base_config: &Config, new_version: &Version) -> Result<()> {
let mut files = new_config.get_files().clone();
files.push(FileConfig {
path: PathBuf::from(DEFAULT_FILENAME),
search: "current_version = \\\"{{current_version}}\\\"".to_string(),
replace: "current_version = \\\"{{new_version}}\\\"".to_string(),
search: "current_version = \"{{current_version}}\"".to_string(),
replace: "current_version = \"{{new_version}}\"".to_string(),
});
for f in files {
let search_text = Tera::one_off(&f.search, &ctx, true)
Expand Down
1 change: 1 addition & 0 deletions tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def test_valid_conf__single_line(cmd, tmp_path: Path): # noqa: D103
proc = cmd("update", "0.2.0")
assert proc.returncode == 0
assert data_txt.read_text() == "0.2.0"
assert 'current_version = "0.2.0"' in (tmp_path / ".age.toml").read_text()


def test_valid_conf__multi_line(cmd, tmp_path: Path): # noqa: D103
Expand Down

0 comments on commit 732f1cd

Please sign in to comment.