Skip to content
Snippets Groups Projects
Unverified Commit f1a2eed1 authored by Fabien's avatar Fabien Committed by GitHub
Browse files

Remove unused scripts/post-install.js (#299)

* Remove unused scripts/post-install.js

* Remove postinstall-build dep and script
parent 33625d10
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,7 @@
"build": "npm run build-browser && npm run build-node",
"build-browser": "rm -rf dist && NODE_ENV=production node ./node_modules/webpack/bin/webpack.js && gzip -k -f ./dist/*.js && du -h ./dist/*",
"build-node": "mkdir -p ./lib && cp -r ./src/* ./lib/ && babel ./src --out-dir ./lib",
"prepublish": "npm run build",
"postinstall": "postinstall-build lib && cross-env scripts/post-install.js"
"prepublish": "npm run build"
},
"browser": {
"ws": false,
......@@ -47,7 +46,6 @@
"detect-node": "^2.0.3",
"ecurve": "^1.0.5",
"lodash": "^4.16.4",
"postinstall-build": "^5.0.1",
"secure-random": "^1.1.1",
"ws": "^3.3.2"
},
......
#!/usr/bin/env node
console.log('Running post install.js');
try {
const root = __dirname.substr(0, __dirname.indexOf('node_modules/'));
if (root === undefined || root.length === 0) { return; }
const packageJSON = require(`${root}package.json`);
const path = require('path');
if (packageJSON.dependencies['react-native']) {
const fs = require('fs');
const index = path.join(__dirname, '..','lib', 'index.js');
const RNIndex = path.join(__dirname, 'index.rn.js');
const indexContent = fs.readFileSync(RNIndex, { encoding: 'utf8' })
if (indexContent) {
fs.unlinkSync(index);
fs.writeFileSync(index, indexContent, 'utf8')
} else {
console.error('could not find index.rn.js');
}
}
}
catch (e) {
console.error('Error running postinstall script', e);
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment