Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration-test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"any-observable": "^0.5.1",
"async-exit-hook": "^2.0.1",
"chalk": "^4.1.0",
"ci-info": "^2.0.0",
"cosmiconfig": "^7.0.0",
"del": "^6.0.0",
"escape-goat": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions source/git-util.js
Original file line number Diff line number Diff line change
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
9 changes: 8 additions & 1 deletion source/ui.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
const inquirer = require('inquirer');
const chalk = require('chalk');
const ciInfo = require('ci-info');
const githubUrlFromGit = require('github-url-from-git');
const {htmlEscape} = require('escape-goat');
const isScoped = require('is-scoped');
Expand Down Expand Up @@ -56,10 +57,16 @@ const checkIgnoredFiles = async pkg => {
return true;
}

const message = `The following new files are not already part of your published package:\n${chalk.reset(ignoredFiles.map(path => `- ${path}`).join('\n'))}`;
if (ciInfo.isCI) {
console.log(message);
return true;
}

const answers = await inquirer.prompt([{
type: 'confirm',
name: 'confirm',
message: `The following new files are not already part of your published package:\n${chalk.reset(ignoredFiles.map(path => `- ${path}`).join('\n'))}\nContinue?`,
message: `${message}\nContinue?`,
default: false
}]);

Expand Down