forked from GeekyAnts/NativeBase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sankhadeep
committed
Feb 8, 2017
1 parent
e8f008e
commit 8b252c2
Showing
7 changed files
with
16 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,10 @@ | ||
var fs = require('fs'); | ||
var util = require('util'); | ||
var path = require('path'); | ||
|
||
var printMessage = require('print-message'); | ||
|
||
fs.copy = function (src, dst, cb) { | ||
console.warn('[Deprecated] See https://github.com/coolaj86/utile-fs'); | ||
function copy(err) { | ||
var is | ||
, os | ||
; | ||
|
||
if (!err) { | ||
return cb(new Error("File " + dst + " exists.")); | ||
} | ||
|
||
fs.stat(src, function (err) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
is = fs.createReadStream(src); | ||
os = fs.createWriteStream(dst); | ||
util.pump(is, os, cb); | ||
}); | ||
} | ||
|
||
fs.stat(dst, copy); | ||
}; | ||
|
||
|
||
var projectPackage = require(path.join(__dirname, 'package.json')); | ||
if(!projectPackage.scripts) { | ||
projectPackage.scripts = {}; | ||
} | ||
|
||
projectPackage.scripts['eject-native-base'] = 'node node_modules/native-base/ejectTheme.js'; | ||
|
||
try { | ||
fs.writeFileSync(path.join(__dirname, '..', '..', 'package.json'), JSON.stringify(projectPackage, null, 2)); | ||
printMessage([ | ||
'NativeBase 2.0 has been succesfully installed!', | ||
'Run `node node_modules/native-base/ejectTheme.js` to copy over theme config and variables.', | ||
'Head over to the docs for detailed information on how to make changes to the theme.', | ||
], { | ||
color: 'yellow', | ||
borderColor: 'green', | ||
}); | ||
} catch(err) { | ||
console.log('Error: ' + err); | ||
console.log('There was some error adding the eject script to your package.json. \nRefer http://docs.nativebase.io/docs/customize/SetUp.html for theming') | ||
} | ||
const printMessage = require('print-message'); | ||
|
||
printMessage([ | ||
'NativeBase 2.0 has been succesfully installed!', | ||
'Run `node node_modules/native-base/ejectTheme.js` to copy over theme config and variables.', | ||
'Head over to the docs for detailed information on how to make changes to the theme.', | ||
], { | ||
color: 'yellow', | ||
borderColor: 'green', | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters