The familar Make / Bash hybrid.
Project description
$ bake
, n:
the s☿rangely familiar task runner.
I love using Makefile
for one-off tasks in projects.
The problem with doing this is that you can't use familiar bash–isms when doing so, as GNU Make doesn't use the familiar Bash syntax, nor does it allow for simple ad–hoc use of arbitrary scripting languages (e.g. Python).
This project seeks to bridge all of these worlds into a single entrypoint — ideal for cross–language repositories.
Features 'n Things
- A
Bakefile
, which looks and feels like the good parts of aMakefile
. - Except, you can write real bash code!
- Environment variables are explicitly passed or whitelisted (allowed), not inherited from the parent shell.
- Unlike
Makefile
, either tabs or 4 spaces can be used. - Tasks can be run safely and reliably. Rest assured that scripts are executed from the project root (e.g. location of the
Bakefile
). - See advanced example for further, juicy, details.
Community / Contrib
- Visual Studio Code Extension — highlights
Bakefile
.
Installing $ bake
MacOS:
$ brew install kennethreitz/-/bake
==> Installing bake from kennethreitz/-
…
🍺 /usr/local/Cellar/bake/19-09-16: 1,563 files, 16.7MB, built in 11 seconds
Various Linux Distributions (Python 3.6+):
$ pip3 install bake-cli
Collecting bake-cli
…
Successfully installed bake-cli-0.2.0 delegator.py-0.1.1 pexpect-4.7.0 ptyprocess-0.6.0
✨🍰✨
$ cat Bakefile
install: install/node install/python
install/full: install/system install
install/python: @skip:key=Pipfile.lock
pipenv install
install/node: @skip:key=yarn.lock
yarn install
install/system: @confirm
brew install pipenv yarn
python/format:
black .
utils/argv:
set -u && echo "$HELLO: $@"
utils/deploy: @confirm:secure
exit 0
Team & Workflow Management
$ bake install
+ Executing install/node:
| yarn install v1.17.3
| info No lockfile found.
| [1/4] Resolving packages...
| [2/4] Fetching packages...
| [3/4] Linking dependencies...
| [4/4] Building fresh packages...
| success Saved lockfile.
| Done in 0.05s.
+ Executing install/python:
| Installing dependencies from Pipfile.lock (f10bb0)…
+ Executing install:
+ Done.
Skip Steps, Automatically
$ bake install
+ Skipping install/node:
+ Skipping install/python.
+ Executing install:
+ Done.
Neat, eh?
Passing Values (Arguments & Parameters)
$ bake utils/argv KEY=VALUE 1 2 3
+ Executing utils/argv:
| WORLD: 1 2 3
+ Done.
Added Peace of Mind
$ bake utils/deploy
What is 10 times 2?: 7
Aborted.
Advanced Usage Sample
Fancy, eh?
This repository has been brought to you, with much joy, by Kenneth Reitz.
As above, so below.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bake-cli-0.7.0.tar.gz
(16.1 kB
view hashes)
Built Distribution
Close
Hashes for bake_cli-0.7.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db5b68d255c7556a2de120a6da9b3a6e29a8d7f249de582fafdeef5566656a85 |
|
MD5 | 85b799f183d715846fb681d189da9522 |
|
BLAKE2b-256 | ca56d7758b2defd9c6eefdfe2beb1e93798cfc9bf52f20a2c3fd804dad79456c |