NPM script for fetching and syncing data between different repos
"config": {
"frontendSSH": "[email protected]...",
"defaultBranch": "master",
"sharedFolderPath": "commonConstants"
},
"scripts": {
"fetchFolderFromRepo": "run(){ branch=${1:-$npm_package_config_defaultBranch} && git archive --remote=$npm_package_config_frontendSSH $branch $npm_package_config_sharedFolderPath/*.js | tar xvf -; }; run",
"removeFolder": "rimraf $npm_package_config_sharedFolderPath/*.js",
"getFolder": "npm run removeFolder && npm run fetchFolderFromRepo"
},