Skip to content

Utility scripts for managing, testing, and editing examples in bulk

Notifications You must be signed in to change notification settings

carbon-io-examples/utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Utils

A set of utility script for managing the examples.

Prerequisites

Download all examples

curl https://api.github.com/orgs/carbon-io-examples/repos\?per_page\=200 | jq -r '.[].ssh_url' | xargs -L 1 git clone

Install Node modules

This will merge together all the examples' package.jsons 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.

Run tests

spread 'npm test'

You can run in specific directories by passing them as arguments after the command to spread:

spread 'npm test' example*

Run commands based on test results with spread

For example, committing and pushing if tests are passed:

spread 'npm test && git checkout -b new-branch && git push origin new-branch'

Useful commands

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"'

About

Utility scripts for managing, testing, and editing examples in bulk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages