diff --git a/lib/plugin/GitBase.js b/lib/plugin/GitBase.js index 605def54..607dc08a 100644 --- a/lib/plugin/GitBase.js +++ b/lib/plugin/GitBase.js @@ -93,8 +93,8 @@ class GitBase extends Plugin { getLatestTagName() { const context = Object.assign({}, this.config.getContext(), { version: '*' }); const match = format(this.options.tagMatch || this.options.tagName || '${version}', context); - const exclude = this.options.tagExclude ? `--exclude=${format(this.options.tagExclude, context)}` : ''; - return this.exec(`git describe --tags --match=${match} --abbrev=0 ${exclude}`, { options }).then( + const exclude = this.options.tagExclude ? ` --exclude=${format(this.options.tagExclude, context)}` : ''; + return this.exec(`git describe --tags --match=${match} --abbrev=0${exclude}`, { options }).then( stdout => stdout || null, () => null );