-
-
Notifications
You must be signed in to change notification settings - Fork 1
How to use cbf in your project
Joshua Vernon edited this page Jan 3, 2020
·
3 revisions
cbf
can run scripts in a lot of different ways...
- Save a
cbf
script and then run it via it's name or from the cbf menuor$ cbf -s script.yml $ cbf -r script ? Choose an option (Use arrow keys) ❯ install build clean lint
$ cbf -s script.yml $ cbf ? Select a script to run it, display help or quit? (Use arrow keys) ❯ cbf ♚ help ? quit ⦸
- Run a script directly from the file
$ cbf -r script.yml Running dev script from cbf.yml file ? Choose an option (Use arrow keys) ❯ install build clean lint test
- Run scripts within
package.json
fileor$ cbf Running scripts from package.json file ? Choose an option (Use arrow keys) ❯ lint ↓ circular format test build clean
$ cbf -j Running scripts from package.json file ? Choose an option (Use arrow keys) ❯ lint ↓ circular format test build clean
- Run a script automatically by naming it
cbf
and adding it to your repo e.g.cbf.yml
orcbf.json
$ cbf Running dev script from cbf.yml file ? Choose an option (Use arrow keys) ❯ install build clean lint test
---
# An example of a `getting started` setup script you could reference in your README.md
# in your repository to make setting up a new project a lot easier for new contributors
setup:
step-1: "brew install python"
"step-2:1": "curl -O http://python-distribute.org/distribute_setup.py"
"step-2:2": "python distribute_setup.py"
"step-2:3": "curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py"
"step-2:4": "python get-pip.py"
step-3: "pip install virtualenv"
step-4: "virtualenv venv"
---
# An example of a `common project commands` script that can be referenced from
# a repository to share commonly used commands within a repo with other contributors
example-project:
message: "Run, build or test example project?"
directory: "~/projects/example"
options:
run:
message: "Running example project..."
command: "yarn start"
build:
directory: "~/projects/example/src"
message: "Building example project..."
command: "yarn install"
test:
message: "Run unit or integration tests?"
options:
unit:
message: "Running example project unit tests"
command: "yarn test:unit"
integration:
message: "Running example project integration tests"
command: "yarn test:integration"
Thanks for using cbf
🦥