From 4e91cb3a808a356adbd3f90235602fa9a8364ad8 Mon Sep 17 00:00:00 2001 From: Valerii Sorokobatko Date: Tue, 31 Jan 2017 22:34:12 +0200 Subject: [PATCH] - remove extra veriable - simplify condition --- packages/react-scripts/scripts/eject.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 70a2a02af28..79b217bb0d7 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -11,15 +11,13 @@ var createJestConfig = require('../utils/createJestConfig'); var fs = require('fs-extra'); var path = require('path'); var paths = require('../config/paths'); -var isReactScriptsLinked = require('../utils/isReactScriptsLinked'); +var reactScriptsLinked = require('../utils/isReactScriptsLinked')(); var prompt = require('react-dev-utils/prompt'); var spawnSync = require('cross-spawn').sync; var chalk = require('chalk'); var green = chalk.green; var cyan = chalk.cyan; -var reactScriptsLinked = isReactScriptsLinked(); - prompt( 'Are you sure you want to eject? This action is permanent.', false @@ -33,13 +31,7 @@ prompt( // NOTE: get ownPath and appPath from config/paths.js ? var ownPath = path.join(__dirname, '..'); - var appPath; - - if (reactScriptsLinked) { - appPath = path.resolve('.'); - } else { - appPath = path.join(ownPath, '..', '..'); - } + var appPath = reactScriptsLinked ? path.resolve('.') : path.join(ownPath, '..', '..'); function verifyAbsent(file) { if (fs.existsSync(path.join(appPath, file))) {