diff --git a/packages/gitmoji-changelog-cli/src/cli.e2e.js b/packages/gitmoji-changelog-cli/src/cli.e2e.js index e6b5e2d..9f86984 100644 --- a/packages/gitmoji-changelog-cli/src/cli.e2e.js +++ b/packages/gitmoji-changelog-cli/src/cli.e2e.js @@ -443,7 +443,7 @@ describe('generate changelog', () => { }) async function makeChanges(fileName) { - fs.writeFileSync(path.join(testDir, fileName)) + fs.writeFileSync(path.join(testDir, fileName), '') } async function makeCustomConfig(config) { diff --git a/packages/gitmoji-changelog-cli/src/cli.js b/packages/gitmoji-changelog-cli/src/cli.js index 24ef57f..03936bd 100644 --- a/packages/gitmoji-changelog-cli/src/cli.js +++ b/packages/gitmoji-changelog-cli/src/cli.js @@ -6,7 +6,7 @@ const semver = require('semver') const semverCompare = require('semver-compare') const rc = require('rc') -const { generateChangelog, logger } = require('@gitmoji-changelog/core') +const { generateChangelog, logger, FunctionalError } = require('@gitmoji-changelog/core') const { buildMarkdownFile, getLatestVersion } = require('@gitmoji-changelog/markdown') const issueReporter = require('issue-reporter') @@ -138,7 +138,7 @@ async function getChangelog(options, projectInfo) { const release = options.release === 'from-package' ? projectInfo.version : options.release if (!semver.valid(release)) { - throw new Error(`${release} is not a valid semver version.`) + throw new FunctionalError(`${release} is not a valid semver version.`) } const enhancedOptions = { diff --git a/packages/gitmoji-changelog-core/src/index.js b/packages/gitmoji-changelog-core/src/index.js index 0800797..8143a40 100644 --- a/packages/gitmoji-changelog-core/src/index.js +++ b/packages/gitmoji-changelog-core/src/index.js @@ -187,4 +187,5 @@ function getLastCommitDate(commits) { module.exports = { generateChangelog, logger, + FunctionalError, }