From b1896088cd8a284d3bc6e4eab697023899557e80 Mon Sep 17 00:00:00 2001 From: Joe Lim Date: Tue, 7 Nov 2017 10:37:40 -0800 Subject: [PATCH] Improve eject message (#3416) * improve eject message * cross os implementation --- scripts/eject.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/eject.js b/scripts/eject.js index 2b859694fce..c8438f5d156 100644 --- a/scripts/eject.js +++ b/scripts/eject.js @@ -54,11 +54,17 @@ 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 + .split('\n') + .map(line => line.match(/ .*/g)[0].trim()) + .join('\n') + + '\n\n' + + chalk.red( 'Remove untracked files, stash or commit any changes, and try again.' - ) + ) ); process.exit(1); }