Skip to content

Commit

Permalink
- remove extra veriable
Browse files Browse the repository at this point in the history
- simplify condition
  • Loading branch information
tuchk4 committed Feb 15, 2017
1 parent d66f3fd commit 4e91cb3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))) {
Expand Down

0 comments on commit 4e91cb3

Please sign in to comment.