add quickInstall script
This commit is contained in:
parent
cc847b089b
commit
10090cd813
|
@ -3,7 +3,8 @@
|
|||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node node_modules/react-native/local-cli/cli.js start"
|
||||
"start": "node node_modules/react-native/local-cli/cli.js start",
|
||||
"quickinstall": "node scripts/quickinstall"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash": "^4.13.1",
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
const exec = require('shell-utils').exec;
|
||||
|
||||
function removeHardlinks() {
|
||||
exec.execSync(`hardlink ./node_modules/react-native-camera-kit/ -u || true`);
|
||||
}
|
||||
|
||||
function removeNodeModules() {
|
||||
exec.execSync(`rm -rf ./node_modules || true`);
|
||||
}
|
||||
|
||||
function copyNodeModules() {
|
||||
exec.execSync(`cp -Rf ../node_modules ./`);
|
||||
}
|
||||
|
||||
function installMain() {
|
||||
exec.execSync(`mkdir -p ./node_modules/react-native-camera-kit`);
|
||||
const tar = exec.execSyncRead(`cd .. && npm pack`);
|
||||
exec.execSync(`tar -xf ../${tar} -C ./node_modules/react-native-camera-kit --strip 1`);
|
||||
exec.execSync(`rm ../${tar}`);
|
||||
}
|
||||
|
||||
function hardlink() {
|
||||
exec.execSync(`hardlink ../ ./node_modules/react-native-camera-kit || true`);
|
||||
}
|
||||
|
||||
function run() {
|
||||
removeHardlinks();
|
||||
removeNodeModules();
|
||||
copyNodeModules();
|
||||
installMain();
|
||||
hardlink();
|
||||
}
|
||||
|
||||
run();
|
Loading…
Reference in New Issue