From 35206c51048844fb3e645398b5c9a0f692f8bb56 Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Tue, 15 Dec 2020 16:05:01 +0100 Subject: [PATCH] fix: Fixed awaits missing --- src/helpers/bumpVersion.js | 4 ++-- src/index.js | 6 +++--- src/version/git.js | 4 ++-- src/version/json.js | 4 ++-- src/version/toml.js | 4 ++-- src/version/yaml.js | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/helpers/bumpVersion.js b/src/helpers/bumpVersion.js index e2f478f..d67c6b7 100644 --- a/src/helpers/bumpVersion.js +++ b/src/helpers/bumpVersion.js @@ -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 diff --git a/src/index.js b/src/index.js index 212ef85..ce228dc 100644 --- a/src/index.js +++ b/src/index.js @@ -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, }) diff --git a/src/version/git.js b/src/version/git.js index 4077c93..0171882 100644 --- a/src/version/git.js +++ b/src/version/git.js @@ -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, ) diff --git a/src/version/json.js b/src/version/json.js index 7a75c52..33ce3ee 100644 --- a/src/version/json.js +++ b/src/version/json.js @@ -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, ) diff --git a/src/version/toml.js b/src/version/toml.js index ff889ee..50aec9a 100644 --- a/src/version/toml.js +++ b/src/version/toml.js @@ -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, ) diff --git a/src/version/yaml.js b/src/version/yaml.js index c29b9b2..1f674cf 100644 --- a/src/version/yaml.js +++ b/src/version/yaml.js @@ -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, )