Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve eject message #3416

Merged
merged 2 commits into from
Nov 7, 2017
Merged
Changes from 1 commit
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
Next Next commit
improve eject message
xjlim committed Nov 6, 2017
commit 6fd044ccba49ec7871f478b1c47c0b76d004b96a
13 changes: 8 additions & 5 deletions packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ const cyan = chalk.cyan;

function getGitStatus() {
try {
let stdout = execSync(`git status --porcelain`, {
let stdout = execSync(`git status --porcelain | awk '{print $2}'`, {
stdio: ['pipe', 'pipe', 'ignore'],
}).toString();
return stdout.trim();
@@ -54,11 +54,14 @@ inquirer
if (gitStatus) {
console.error(
chalk.red(
`This git repository has untracked files or uncommitted changes:\n\n` +
gitStatus.split('\n').map(line => ' ' + line) +
'\n\n' +
'This git repository has untracked files or uncommitted changes:'
) +
'\n\n' +
gitStatus +
'\n\n' +
chalk.red(
'Remove untracked files, stash or commit any changes, and try again.'
)
)
);
process.exit(1);
}