From 040d8e90f4548fdebc6fe291763582d202c62e88 Mon Sep 17 00:00:00 2001 From: Egor Kurnev Date: Mon, 14 Dec 2020 20:21:30 +0300 Subject: [PATCH] fix: Remove unneded import. More precise path for requiring hooks --- src/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 54ffa95..429084a 100644 --- a/src/index.js +++ b/src/index.js @@ -5,7 +5,6 @@ const path = require('path') const getVersioning = require('./version') const git = require('./helpers/git') const changelog = require('./helpers/generateChangelog') -const resolve = require('path').resolve async function handleVersioningByExtension(ext, file, versionPath, releaseType) { const versioning = getVersioning(ext) @@ -66,7 +65,7 @@ async function run() { core.info('Pull to make sure we have the full git history') await git.pull() - const config = conventionalConfigFile && require(resolve(process.cwd(), conventionalConfigFile)) + const config = conventionalConfigFile && require(path.resolve(process.cwd(), conventionalConfigFile)) conventionalRecommendedBump({ preset, tagPrefix, config }, async (error, recommendation) => { if (error) { @@ -113,7 +112,7 @@ async function run() { let gitTag = `${tagPrefix}${newVersion}` if (preChangelogGeneration) { - const newVersionAndTag = await require(path.resolve(preChangelogGeneration)).preChangelogGeneration({ + const newVersionAndTag = await require(path.resolve(process.cwd(), preChangelogGeneration)).preChangelogGeneration({ tag: gitTag, version: newVersion, }) @@ -149,7 +148,7 @@ async function run() { if (!skipCommit) { // Add changed files to git if (preCommit) { - await require(path.resolve(preCommit)).preCommit({ + await require(path.resolve(process.cwd(), preCommit)).preCommit({ tag: gitTag, version: newVersion, })