Skip to content

Commit adb1ca2

Browse files
committed
chore(tooling): Use more robust tool for manifest version bumps
1 parent 488661b commit adb1ca2

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

build-aux/cargo-updater.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
const TOML = require('@iarna/toml')
2+
const { exec } = require('node:child_process')
23

34
module.exports.readVersion = function (contents) {
45
const data = TOML.parse(contents)
56
return data.package.version
67
}
78

89
module.exports.writeVersion = function (contents, version) {
9-
const data = TOML.parse(contents)
10-
data.package.version = version
11-
return TOML.stringify(data)
10+
exec('cargo-set-version set-version ' + version, (err, output) => {
11+
if (err) {
12+
console.error("Could not run Cargo subcommand to set version: ", err)
13+
return
14+
}
15+
})
16+
return contents
1217
}

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ AM_COND_IF([FONT_DOWNLOAD_TOOLS], [
178178

179179
AM_COND_IF([DEVELOPER_MODE], [
180180
QUE_PROGVAR([busted])
181+
QUE_PROGVAR([cargosetversion], [cargo-set-version])
181182
QUE_PROGVAR([curl])
182183
QUE_PROGVAR([delta])
183184
QUE_PROGVAR([diff])
@@ -189,6 +190,7 @@ AM_COND_IF([DEVELOPER_MODE], [
189190
QUE_PROGVAR([npm])
190191
QUE_PROGVAR([perl])
191192
QUE_PROGVAR([stylua])
193+
QUE_PROGVAR([taplo])
192194
QUE_PROGVAR([tr])
193195
QUE_PROGVAR([typos])
194196
])

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
}
5252
],
5353
"scripts": {
54-
"postbump": "cargo generate-lockfile --offline",
54+
"postbump": "taplo format Cargo.toml && cargo generate-lockfile --offline",
5555
"postcommit": "git add -u Cargo.lock && git commit --amend --no-edit"
5656
},
5757
"infile": "CHANGELOG.md",

0 commit comments

Comments
 (0)