Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"import-local": "^3.0.2",
"inquirer": "^7.3.3",
"is-installed-globally": "^0.3.2",
"is-interactive": "^1.0.0",
"is-scoped": "^2.1.0",
"issue-regex": "^3.1.0",
"listr": "^0.14.3",
Expand Down
9 changes: 8 additions & 1 deletion source/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const chalk = require('chalk');
const githubUrlFromGit = require('github-url-from-git');
const {htmlEscape} = require('escape-goat');
const isScoped = require('is-scoped');
const isInteractive = require('is-interactive');
const util = require('./util');
const git = require('./git-util');
const {prereleaseTags, checkIgnoreStrategy, getRegistryUrl, isExternalRegistry} = require('./npm/util');
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 (!isInteractive()) {
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