fix: Fixed awaits missing
parent
609a140e1f
commit
35206c5104
|
@ -10,7 +10,7 @@ const requireScript = require('./requireScript')
|
||||||
* @param version
|
* @param version
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
module.exports = (releaseType, version) => {
|
module.exports = async (releaseType, version) => {
|
||||||
let major, minor, patch
|
let major, minor, patch
|
||||||
|
|
||||||
if (version) {
|
if (version) {
|
||||||
|
@ -55,7 +55,7 @@ module.exports = (releaseType, version) => {
|
||||||
|
|
||||||
// Double check if we want to update / do something with the version
|
// Double check if we want to update / do something with the version
|
||||||
if (preChangelogGenerationScript && preChangelogGenerationScript.preVersionGeneration) {
|
if (preChangelogGenerationScript && preChangelogGenerationScript.preVersionGeneration) {
|
||||||
const modifiedVersion = preChangelogGenerationScript.preVersionGeneration(newVersion)
|
const modifiedVersion = await preChangelogGenerationScript.preVersionGeneration(newVersion)
|
||||||
|
|
||||||
if (modifiedVersion) {
|
if (modifiedVersion) {
|
||||||
newVersion = modifiedVersion
|
newVersion = modifiedVersion
|
||||||
|
|
|
@ -120,7 +120,7 @@ async function run() {
|
||||||
|
|
||||||
// Double check if we want to update / do something with the tag
|
// Double check if we want to update / do something with the tag
|
||||||
if (preChangelogGenerationScript && preChangelogGenerationScript.preTagGeneration) {
|
if (preChangelogGenerationScript && preChangelogGenerationScript.preTagGeneration) {
|
||||||
const modifiedTag = preChangelogGenerationScript.preTagGeneration(gitTag)
|
const modifiedTag = await preChangelogGenerationScript.preTagGeneration(gitTag)
|
||||||
|
|
||||||
if (modifiedTag) {
|
if (modifiedTag) {
|
||||||
gitTag = modifiedTag
|
gitTag = modifiedTag
|
||||||
|
@ -153,11 +153,11 @@ async function run() {
|
||||||
if (!skipCommit) {
|
if (!skipCommit) {
|
||||||
// Add changed files to git
|
// Add changed files to git
|
||||||
if (preCommitFile) {
|
if (preCommitFile) {
|
||||||
const preCommitScript = await requireScript(preCommitFile)
|
const preCommitScript = requireScript(preCommitFile)
|
||||||
|
|
||||||
// Double check if the file exists and the export exists
|
// Double check if the file exists and the export exists
|
||||||
if (preCommitScript && preCommitScript.preCommit) {
|
if (preCommitScript && preCommitScript.preCommit) {
|
||||||
preCommitScript.preCommit({
|
await preCommitScript.preCommit({
|
||||||
tag: gitTag,
|
tag: gitTag,
|
||||||
version: newVersion,
|
version: newVersion,
|
||||||
})
|
})
|
||||||
|
|
|
@ -12,11 +12,11 @@ module.exports = new (class Git extends BaseVersioning {
|
||||||
|
|
||||||
gitSemverTags({
|
gitSemverTags({
|
||||||
tagPrefix,
|
tagPrefix,
|
||||||
}, (err, tags) => {
|
}, async (err, tags) => {
|
||||||
const currentVersion = tags.length > 0 ? tags.shift().replace(tagPrefix, '') : null
|
const currentVersion = tags.length > 0 ? tags.shift().replace(tagPrefix, '') : null
|
||||||
|
|
||||||
// Get the new version
|
// Get the new version
|
||||||
this.newVersion = bumpVersion(
|
this.newVersion = await bumpVersion(
|
||||||
releaseType,
|
releaseType,
|
||||||
currentVersion,
|
currentVersion,
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,7 +12,7 @@ module.exports = new (class Json extends BaseVersioning {
|
||||||
* @param {!string} releaseType - The type of release
|
* @param {!string} releaseType - The type of release
|
||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
bump = (releaseType) => {
|
bump = async (releaseType) => {
|
||||||
// Read the file
|
// Read the file
|
||||||
const fileContent = this.read()
|
const fileContent = this.read()
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ module.exports = new (class Json extends BaseVersioning {
|
||||||
const oldVersion = objectPath.get(jsonContent, this.versionPath, null)
|
const oldVersion = objectPath.get(jsonContent, this.versionPath, null)
|
||||||
|
|
||||||
// Get the new version
|
// Get the new version
|
||||||
this.newVersion = bumpVersion(
|
this.newVersion = await bumpVersion(
|
||||||
releaseType,
|
releaseType,
|
||||||
oldVersion,
|
oldVersion,
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,14 +12,14 @@ module.exports = new (class Toml extends BaseVersioning{
|
||||||
* @param {!string} releaseType - The type of release
|
* @param {!string} releaseType - The type of release
|
||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
bump = (releaseType) => {
|
bump = async(releaseType) => {
|
||||||
// Read the file
|
// Read the file
|
||||||
const fileContent = this.read()
|
const fileContent = this.read()
|
||||||
const tomlContent = toml.parse(fileContent)
|
const tomlContent = toml.parse(fileContent)
|
||||||
const oldVersion = objectPath.get(tomlContent, this.versionPath, null)
|
const oldVersion = objectPath.get(tomlContent, this.versionPath, null)
|
||||||
|
|
||||||
// Get the new version
|
// Get the new version
|
||||||
this.newVersion = bumpVersion(
|
this.newVersion = await bumpVersion(
|
||||||
releaseType,
|
releaseType,
|
||||||
oldVersion,
|
oldVersion,
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,14 +12,14 @@ module.exports = new (class Yaml extends BaseVersioning{
|
||||||
* @param {!string} releaseType - The type of release
|
* @param {!string} releaseType - The type of release
|
||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
bump = (releaseType) => {
|
bump = async (releaseType) => {
|
||||||
// Read the file
|
// Read the file
|
||||||
const fileContent = this.read()
|
const fileContent = this.read()
|
||||||
const yamlContent = yaml.parse(fileContent) || {}
|
const yamlContent = yaml.parse(fileContent) || {}
|
||||||
const oldVersion = objectPath.get(yamlContent, this.versionPath, null)
|
const oldVersion = objectPath.get(yamlContent, this.versionPath, null)
|
||||||
|
|
||||||
// Get the new version
|
// Get the new version
|
||||||
this.newVersion = bumpVersion(
|
this.newVersion =await bumpVersion(
|
||||||
releaseType,
|
releaseType,
|
||||||
oldVersion,
|
oldVersion,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue