Skip to content

Commit 707bad6

Browse files
author
Nick Balestra
committed
eject wip
1 parent ebdb1a7 commit 707bad6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/cycle-scripts/scripts/eject.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ const path = require('path')
55
const chalk = require('chalk')
66
const inquirer = require('inquirer')
77

8+
const scriptsPath = path.join(process.cwd(), 'scripts')
89
const ownPackageJsonPath = path.resolve(__dirname, '..', 'package.json')
910
const appPackageJsonPath = path.join(process.cwd(), 'package.json')
1011
const ownPackageJson = JSON.parse(fs.readFileSync(ownPackageJsonPath))
1112
const appPackageJson = JSON.parse(fs.readFileSync(appPackageJsonPath))
12-
const scriptsPath = path.join(process.cwd(), 'scripts')
1313

14+
// Ask the user for confirmation before ejecting.
15+
// Abort in case of negative answer (default)
1416
const ejectConfirmation = {
1517
type: 'confirm',
1618
name: 'doEject',
@@ -41,9 +43,6 @@ Object.keys(appPackageJson.devDependencies)
4143
})
4244
devDependencies = Object.assign({}, devDependencies, ownPackageJson.dependencies)
4345

44-
// Delete babel config in package.json
45-
delete appPackageJson.babel
46-
4746
// Write the new package.json
4847
const newPackageJson = Object.assign({}, appPackageJson, {scripts: scripts, devDependencies: devDependencies})
4948
fs.writeFileSync(
@@ -63,3 +62,5 @@ copyScript('build.js')
6362

6463
// Copy configs
6564
fs.copySync(path.join(__dirname, '../', 'configs'), path.join('configs'))
65+
66+
// Todo: provide some success info on success

0 commit comments

Comments
 (0)