Skip to content

Commit 4bec877

Browse files
xjlimTimer
authored andcommitted
Improve eject message (#3416)
* improve eject message * cross os implementation
1 parent 5b4ff56 commit 4bec877

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/react-scripts/scripts/eject.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,17 @@ inquirer
5454
if (gitStatus) {
5555
console.error(
5656
chalk.red(
57-
`This git repository has untracked files or uncommitted changes:\n\n` +
58-
gitStatus.split('\n').map(line => ' ' + line) +
59-
'\n\n' +
57+
'This git repository has untracked files or uncommitted changes:'
58+
) +
59+
'\n\n' +
60+
gitStatus
61+
.split('\n')
62+
.map(line => line.match(/ .*/g)[0].trim())
63+
.join('\n') +
64+
'\n\n' +
65+
chalk.red(
6066
'Remove untracked files, stash or commit any changes, and try again.'
61-
)
67+
)
6268
);
6369
process.exit(1);
6470
}

0 commit comments

Comments
 (0)