Skip to content

Commit

Permalink
chore(tooling): Use more robust tool for manifest version bumps
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Nov 19, 2024
1 parent 2a20dbf commit 7d2a57d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions build-aux/cargo-updater.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
const TOML = require('@iarna/toml')
const { exec } = require('node:child_process')

module.exports.readVersion = function (contents) {
const data = TOML.parse(contents)
return data.package.version
}

module.exports.writeVersion = function (contents, version) {
const data = TOML.parse(contents)
data.package.version = version
return TOML.stringify(data)
exec('cargo-set-version set-version ' + version, (err, output) => {
if (err) {
console.error("Could not run Cargo subcommand to set version: ", err)
return
}
})
return contents
}
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ AM_COND_IF([DEPENDENCY_CHECKS], [
])

AM_COND_IF([DEVELOPER_MODE], [
QUE_PROGVAR([cargosetversion], [cargo-set-version])
QUE_PROGVAR([checkmake])
QUE_PROGVAR([luacheck])
QUE_PROGVAR([ruff])
QUE_PROGVAR([stylua])
QUE_PROGVAR([tr])
QUE_PROGVAR([taplo])
QUE_PROGVAR([tr])
QUE_PROGVAR([typos])
])

Expand Down

0 comments on commit 7d2a57d

Please sign in to comment.