A set of utility script for managing the examples.
- jq:
brew install jq
- package-json-merge:
npm i -g package-json-merge
- spread:
brew install tfogo/tools/spread
curl https://api.github.com/orgs/carbon-io-examples/repos\?per_page\=200 | jq -r '.[].ssh_url' | xargs -L 1 git clone
This will merge together all the examples' package.json
s and install the modules in the parent folder. That way you only need to install the modules for each example once.
ls */package.json | xargs package-json-merge > package.json
npm i
Optionally, link any modules for testing, e.g. npm link @carbon-io/carbond
.
spread 'npm test'
You can run in specific directories by passing them as arguments after the command to spread:
spread 'npm test' example*
For example, committing and pushing if tests are passed:
spread 'npm test && git checkout -b new-branch && git push origin new-branch'
Most bulk updates are to the READMEs.
sed -i "" -e "s/io-0\.7/io-0.8/g" README.md
Simply list success or fail for tests:
spread 'pwd && npm test &> /dev/null && echo "Success\n" || echo "Fail\n"'