From 9930dac69ef405aeeb2328437f985b5c9b76730b Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Thu, 4 Oct 2018 01:19:21 -0400 Subject: [PATCH] fix: add `cwd` to `ENOGITREPO` error message --- lib/definitions/errors.js | 4 ++-- lib/verify.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/definitions/errors.js b/lib/definitions/errors.js index de5611ac..a63b81ee 100644 --- a/lib/definitions/errors.js +++ b/lib/definitions/errors.js @@ -9,11 +9,11 @@ const stringify = obj => (isString(obj) ? obj : inspect(obj, {breakLength: Infin const linkify = file => `${homepage}/blob/caribou/${file}`; module.exports = { - ENOGITREPO: () => ({ + ENOGITREPO: ({cwd}) => ({ message: 'Not running from a git repository.', details: `The \`semantic-release\` command must be executed from a Git repository. -The current working directory is \`${process.cwd()}\`. +The current working directory is \`${cwd}\`. Please verify your CI configuration to make sure the \`semantic-release\` command is executed from the root of the cloned repository.`, }), diff --git a/lib/verify.js b/lib/verify.js index b1d25ffb..462d9a60 100644 --- a/lib/verify.js +++ b/lib/verify.js @@ -7,7 +7,7 @@ module.exports = async ({cwd, env, options: {repositoryUrl, tagFormat}}) => { const errors = []; if (!(await isGitRepo({cwd, env}))) { - errors.push(getError('ENOGITREPO')); + errors.push(getError('ENOGITREPO', {cwd})); } else if (!repositoryUrl) { errors.push(getError('ENOREPOURL')); }