@@ -2,47 +2,45 @@ const fs = require("fs");
22const path = require ( "path" ) ;
33const yaml = require ( "js-yaml" ) ;
44
5- export const bumpChartVersion = ( ) => {
6- const rootDir = path . join ( __dirname , ".." ) ;
5+ const rootDir = path . join ( __dirname , ".." ) ;
76
8- const chartYamlPath = path . join (
9- rootDir ,
10- "helm-charts" ,
11- "catalogi" ,
12- "Chart.yaml"
13- ) ;
7+ const chartYamlPath = path . join (
8+ rootDir ,
9+ "helm-charts" ,
10+ "catalogi" ,
11+ "Chart.yaml"
12+ ) ;
1413
15- try {
16- const chartYamlContent = fs . readFileSync ( chartYamlPath , "utf8" ) ;
17- const chartYaml = yaml . load ( chartYamlContent ) ;
18- const currentVersion = chartYaml . version ;
14+ try {
15+ const chartYamlContent = fs . readFileSync ( chartYamlPath , "utf8" ) ;
16+ const chartYaml = yaml . load ( chartYamlContent ) ;
17+ const currentVersion = chartYaml . version ;
1918
20- // --- This is the new, dependency-free logic ---
21- const parts = currentVersion . split ( "." ) ;
22- if ( parts . length !== 3 ) {
23- throw new Error (
24- `Chart version "${ currentVersion } " is not a valid x.y.z format.`
25- ) ;
26- }
19+ // --- This is the new, dependency-free logic ---
20+ const parts = currentVersion . split ( "." ) ;
21+ if ( parts . length !== 3 ) {
22+ throw new Error (
23+ `Chart version "${ currentVersion } " is not a valid x.y.z format.`
24+ ) ;
25+ }
2726
28- const patch = parseInt ( parts [ 2 ] , 10 ) ;
29- if ( isNaN ( patch ) ) {
30- throw new Error ( `Patch version "${ parts [ 2 ] } " is not a valid number.` ) ;
31- }
27+ const patch = parseInt ( parts [ 2 ] , 10 ) ;
28+ if ( isNaN ( patch ) ) {
29+ throw new Error ( `Patch version "${ parts [ 2 ] } " is not a valid number.` ) ;
30+ }
3231
33- parts [ 2 ] = patch + 1 ;
34- const newVersion = parts . join ( "." ) ;
35- // --- End of new logic ---
32+ parts [ 2 ] = patch + 1 ;
33+ const newVersion = parts . join ( "." ) ;
34+ // --- End of new logic ---
3635
37- console . log (
38- `Bumping Helm chart version from ${ currentVersion } to ${ newVersion } ...`
39- ) ;
40- chartYaml . version = newVersion ;
41- const newChartYamlContent = yaml . dump ( chartYaml ) ;
42- fs . writeFileSync ( chartYamlPath , newChartYamlContent , "utf8" ) ;
43- console . log ( "✅ Helm chart version bumped." ) ;
44- } catch ( error ) {
45- console . error ( "❌ Error bumping Helm chart version:" , error . message ) ;
46- process . exit ( 1 ) ;
47- }
48- } ;
36+ console . log (
37+ `Bumping Helm chart version from ${ currentVersion } to ${ newVersion } ...`
38+ ) ;
39+ chartYaml . version = newVersion ;
40+ const newChartYamlContent = yaml . dump ( chartYaml ) ;
41+ fs . writeFileSync ( chartYamlPath , newChartYamlContent , "utf8" ) ;
42+ console . log ( "✅ Helm chart version bumped." ) ;
43+ } catch ( error ) {
44+ console . error ( "❌ Error bumping Helm chart version:" , error . message ) ;
45+ process . exit ( 1 ) ;
46+ }
0 commit comments