Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/updateVersion.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const cli = meow(
const START_OF_LAST_RELEASE_PATTERN = /(^#+ \[?[0-9]+\.[0-9]+\.[0-9]+|<a name=)/m
const HEADER = `# Changelog\n\nAll notable changes to this project will be documented in this file. See [Convential Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification) for commit guidelines.\n\n`

const execPromise = (command) => new Promise((r) => exec(command, (e, out) => (e && r(e)) || r(out)))
const execPromise = (command) =>
new Promise((resolve, reject) => exec(command, (e, out) => (e && reject(e)) || resolve(out)))
Comment on lines +40 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to use:

const execPromise = promisify(exec)

Like in https://github.com/Sofie-Automation/sofie-package-manager/blob/main/scripts/test-everything.js#L6 and some other places?


const packageFile = JSON.parse(await readFile('./package.json', { encoding: 'utf-8' }))
const isMonoRepo = !!packageFile.workspaces
Expand Down Expand Up @@ -182,7 +183,7 @@ if (!cli.flags.dryRun) {
await execPromise(`git add */package.json`)
}

await execPromise(`git commit -m "chore(release): v${nextVersion}"`)
await execPromise(`git commit --no-verify -m "chore(release): v${nextVersion}"`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not keen on this - I think if there is a pre-commit that fails, something weird is going on and we shouldn't proceed with making a new version until it's fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh... this is only commiting a readme and the package.json so the precommit isn't all that relevant imo


// create tag
await execPromise(`git tag v${nextVersion}`)
Expand Down