Skip to content

Commit

Permalink
Handle long path names in the "show files added since last release" f…
Browse files Browse the repository at this point in the history
…eature (#579)

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
bunysae and sindresorhus committed Dec 21, 2020
1 parent 4ae26d9 commit 3466903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/git-util.js
Expand Up @@ -12,8 +12,8 @@ exports.latestTag = async () => {

exports.newFilesSinceLastRelease = async () => {
try {
const {stdout} = await execa('git', ['diff', '--stat', '--diff-filter=A', await this.latestTag(), 'HEAD']);
const result = stdout.trim().split('\n').slice(0, -1).map(row => row.slice(0, row.indexOf('|')).trim());
const {stdout} = await execa('git', ['diff', '--name-only', '--diff-filter=A', await this.latestTag(), 'HEAD']);
const result = stdout.trim().split('\n').map(row => row.trim());
return result;
} catch {
// Get all files under version control
Expand Down

0 comments on commit 3466903

Please sign in to comment.