Skip to content

Commit 5fa924c

Browse files
committed
fix: Improve version handling and regex replacements in updaters
1 parent 868e5fc commit 5fa924c

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ All notable changes for each version of the Ambient Music extension.
66

77
## v0.8.2 2025 08 24
88

9+
### Fixed
10+
11+
- Corrected version handling to preserve 'v' prefix in `versionUtil.ts`.
12+
- Updated `regexReplace` patterns in `dockerUpdater.ts` to correctly replace only the version string.
13+
- Updated `regexReplace` patterns in `pythonUpdater.ts` to correctly replace only the version string.
14+
915
### Added
1016

1117
- Implemented automatic release branch creation and pull request generation for version bumps.

dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33331,12 +33331,12 @@ class PythonUpdater {
3333133331
switch (this.manifestPath) {
3333233332
case 'pyproject.toml':
3333333333
this.manifestParser.updateVersion(this.manifestPath, newVersion, 'regex', {
33334-
regexReplace: /version\s*=\s*"[^"]+"/,
33334+
regexReplace: /"[^"]+"/,
3333533335
});
3333633336
break;
3333733337
case 'setup.py':
3333833338
this.manifestParser.updateVersion(this.manifestPath, newVersion, 'regex', {
33339-
regexReplace: /version\s*=\s*["'][^"']+["']/, // Matches single or double quotes
33339+
regexReplace: /["'][^"']+''/,
3334033340
});
3334133341
break;
3334233342
default:

src/updaters/dockerUpdater.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class DockerUpdater implements UpdaterInterface {
3131

3232
const newVersion = calculateNextVersion(current, releaseType);
3333
this.manifestParser.updateVersion(this.manifestPath, newVersion, 'regex', {
34-
regexReplace: /LABEL version="[^"]+"/,
34+
regexReplace: /"[^"]+"/,
3535
});
3636

3737
return newVersion;

src/updaters/pythonUpdater.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ export class PythonUpdater implements UpdaterInterface {
4444
switch (this.manifestPath) {
4545
case 'pyproject.toml':
4646
this.manifestParser.updateVersion(this.manifestPath, newVersion, 'regex', {
47-
regexReplace: /version\s*=\s*"[^"]+"/,
47+
regexReplace: /"[^"]+"/,
4848
});
4949
break;
5050
case 'setup.py':
5151
this.manifestParser.updateVersion(this.manifestPath, newVersion, 'regex', {
52-
regexReplace: /version\s*=\s*["'][^"']+["']/, // Matches single or double quotes
52+
regexReplace: /["'][^"']+''/,
5353
});
5454
break;
5555
default:

0 commit comments

Comments
 (0)