@@ -73,7 +73,7 @@ async function patchCsproj(file: string, version: SemVer) {
7373}
7474
7575async function patchPomXml ( file : string , version : SemVer ) {
76- const { def } = semverFormats ( version ) ;
76+ const { original } = semverFormats ( version ) ;
7777 const contents = await Deno . readTextFile ( file ) ;
7878 const document = xml . parse ( contents , {
7979 captureSpacesBetweenElements : true ,
@@ -94,7 +94,7 @@ async function patchPomXml(file: string, version: SemVer) {
9494 } else if ( el . type === "element" && el . name === "version" ) {
9595 const value = el . elements [ 0 ] ;
9696 if ( value . type === "text" ) {
97- value . text = def ;
97+ value . text = original ;
9898 isVersionSet = true ;
9999 break ;
100100 }
@@ -116,24 +116,24 @@ async function patchPomXml(file: string, version: SemVer) {
116116}
117117
118118async function patchPackageJson ( file : string , version : SemVer ) {
119- const { def } = semverFormats ( version ) ;
119+ const { original } = semverFormats ( version ) ;
120120 const contents = await Deno . readTextFile ( file ) ;
121- const edits = JSONC . modify ( contents , [ "version" ] , def , { } ) ;
121+ const edits = JSONC . modify ( contents , [ "version" ] , original , { } ) ;
122122 const result = JSONC . applyEdits ( contents , edits ) ;
123123 await Deno . writeTextFile ( file , result ) ;
124124}
125125
126126async function patchPackageLockJson ( packageJsonPath : string , version : SemVer ) {
127- const { def } = semverFormats ( version ) ;
127+ const { original } = semverFormats ( version ) ;
128128 const dir = path . dirname ( packageJsonPath ) ;
129129 const packageLockJsonPath = path . resolve ( dir , "package-lock.json" ) ;
130130 if ( await exists ( packageLockJsonPath ) ) {
131131 const contents = await Deno . readTextFile ( packageLockJsonPath ) ;
132- const versionEdits = JSONC . modify ( contents , [ "version" ] , def , { } ) ;
132+ const versionEdits = JSONC . modify ( contents , [ "version" ] , original , { } ) ;
133133 const moduleVersionEdits = JSONC . modify (
134134 contents ,
135135 [ "packages" , "" , "version" ] ,
136- def ,
136+ original ,
137137 { } ,
138138 ) ;
139139 const edits = [ ...versionEdits , ...moduleVersionEdits ] ;
@@ -143,11 +143,11 @@ async function patchPackageLockJson(packageJsonPath: string, version: SemVer) {
143143}
144144
145145async function patchChartYaml ( file : string , version : SemVer ) {
146- const { def } = semverFormats ( version ) ;
146+ const { original } = semverFormats ( version ) ;
147147 const contents = await Deno . readTextFile ( file ) ;
148148 const result = contents . replace (
149149 / ^ v e r s i o n : \s * ( .* ) $ / m,
150- `version: ${ def } ` ,
150+ `version: ${ original } ` ,
151151 ) ;
152152 await Deno . writeTextFile ( file , result ) ;
153153}
0 commit comments