fix: Fixed awaits missing

releases/v3
Tycho Bokdam 2020-12-15 16:05:01 +01:00
parent 609a140e1f
commit 35206c5104
No known key found for this signature in database
GPG Key ID: A0FAE77C8CDF33C7
6 changed files with 13 additions and 13 deletions

View File

@ -10,7 +10,7 @@ const requireScript = require('./requireScript')
* @param version
* @returns {string}
*/
module.exports = (releaseType, version) => {
module.exports = async (releaseType, version) => {
let major, minor, patch
if (version) {
@ -55,7 +55,7 @@ module.exports = (releaseType, version) => {
// Double check if we want to update / do something with the version
if (preChangelogGenerationScript && preChangelogGenerationScript.preVersionGeneration) {
const modifiedVersion = preChangelogGenerationScript.preVersionGeneration(newVersion)
const modifiedVersion = await preChangelogGenerationScript.preVersionGeneration(newVersion)
if (modifiedVersion) {
newVersion = modifiedVersion

View File

@ -120,7 +120,7 @@ async function run() {
// Double check if we want to update / do something with the tag
if (preChangelogGenerationScript && preChangelogGenerationScript.preTagGeneration) {
const modifiedTag = preChangelogGenerationScript.preTagGeneration(gitTag)
const modifiedTag = await preChangelogGenerationScript.preTagGeneration(gitTag)
if (modifiedTag) {
gitTag = modifiedTag
@ -153,11 +153,11 @@ async function run() {
if (!skipCommit) {
// Add changed files to git
if (preCommitFile) {
const preCommitScript = await requireScript(preCommitFile)
const preCommitScript = requireScript(preCommitFile)
// Double check if the file exists and the export exists
if (preCommitScript && preCommitScript.preCommit) {
preCommitScript.preCommit({
await preCommitScript.preCommit({
tag: gitTag,
version: newVersion,
})

View File

@ -12,11 +12,11 @@ module.exports = new (class Git extends BaseVersioning {
gitSemverTags({
tagPrefix,
}, (err, tags) => {
}, async (err, tags) => {
const currentVersion = tags.length > 0 ? tags.shift().replace(tagPrefix, '') : null
// Get the new version
this.newVersion = bumpVersion(
this.newVersion = await bumpVersion(
releaseType,
currentVersion,
)

View File

@ -12,7 +12,7 @@ module.exports = new (class Json extends BaseVersioning {
* @param {!string} releaseType - The type of release
* @return {*}
*/
bump = (releaseType) => {
bump = async (releaseType) => {
// Read the file
const fileContent = this.read()
@ -33,7 +33,7 @@ module.exports = new (class Json extends BaseVersioning {
const oldVersion = objectPath.get(jsonContent, this.versionPath, null)
// Get the new version
this.newVersion = bumpVersion(
this.newVersion = await bumpVersion(
releaseType,
oldVersion,
)

View File

@ -12,14 +12,14 @@ module.exports = new (class Toml extends BaseVersioning{
* @param {!string} releaseType - The type of release
* @return {*}
*/
bump = (releaseType) => {
bump = async(releaseType) => {
// Read the file
const fileContent = this.read()
const tomlContent = toml.parse(fileContent)
const oldVersion = objectPath.get(tomlContent, this.versionPath, null)
// Get the new version
this.newVersion = bumpVersion(
this.newVersion = await bumpVersion(
releaseType,
oldVersion,
)

View File

@ -12,14 +12,14 @@ module.exports = new (class Yaml extends BaseVersioning{
* @param {!string} releaseType - The type of release
* @return {*}
*/
bump = (releaseType) => {
bump = async (releaseType) => {
// Read the file
const fileContent = this.read()
const yamlContent = yaml.parse(fileContent) || {}
const oldVersion = objectPath.get(yamlContent, this.versionPath, null)
// Get the new version
this.newVersion = bumpVersion(
this.newVersion =await bumpVersion(
releaseType,
oldVersion,
)