Offer to set default browsers (#3792)

* Offer to set browser defaults

* Catch error on no

* Add ending newlines

* Ensure we re-check to prevent defaults from leaking

* Reduce nesting

* Add defaults message

* More explicit
This commit is contained in:
Joe Haddad
2018-01-14 13:54:01 -05:00
parent 0ff234949f
commit 2e59c5412c
9 changed files with 139 additions and 60 deletions

View File

@@ -22,6 +22,7 @@ const paths = require('../config/paths');
const createJestConfig = require('./utils/createJestConfig');
const inquirer = require('react-dev-utils/inquirer');
const spawnSync = require('react-dev-utils/crossSpawn').sync;
const os = require('os');
const green = chalk.green;
const cyan = chalk.cyan;
@@ -218,7 +219,7 @@ inquirer
fs.writeFileSync(
path.join(appPath, 'package.json'),
JSON.stringify(appPackage, null, 2) + '\n'
JSON.stringify(appPackage, null, 2) + os.EOL
);
console.log();