Skip to main content

The familar Make / Bash hybrid.

Project description

vanity image

    $ 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 a Makefile.
  • 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


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

full-install: system-deps install
install: node-deps python-deps
format:
    black .

python-deps: @skip:key=Pipfile.lock
    pipenv install
node-deps: @skip:key=yarn.lock
    yarn install
system-deps: @confirm
    brew install pipenv

python-example:
    #!/usr/bin/env python
    import os
    import sys

    print(os.environ['KEY'])
    print(sys.argv[1:])

dangerous-example: @confirm:secure
    # <insert deploy to production here>
    exit 0

$ bake install

 + Executing 'node-deps':
yarn install v1.17.3
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.03s.
 + Executing 'python-deps':
Installing dependencies from Pipfile.lock (2ee04c)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 8/8 — 00:00:01
 + Done.

$ bake python-example KEY=VALUE 1 2 3

 + Executing 'python-argv':
   VALUE
   ['1', '2', '3']
 + Done.

$ bake dangerous-example

+ Executing '@confirm:secure' ·
   What is 10 times 2?: 7
Aborted.

Advanced Usage Sample

advanced screenshot

Fancy, eh?


This repository has been brought to you, with much joy, by Kenneth Reitz.

kr soul icon

As above, so below.

Project details


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.6.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

bake_cli-0.6.0-py2.py3-none-any.whl (16.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file bake-cli-0.6.0.tar.gz.

File metadata

  • Download URL: bake-cli-0.6.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for bake-cli-0.6.0.tar.gz
Algorithm Hash digest
SHA256 cbe0f1a34b4e8ebda6fe5e7ac76981a9dd4e7c93b21017f43e47e137c62d0291
MD5 c607fd5a6f1d523adec98ac3d1d42867
BLAKE2b-256 8a6a8067153791f28062151959d7bc9e98afe7b6c5805cf2d5474c40d1343cbc

See more details on using hashes here.

Provenance

File details

Details for the file bake_cli-0.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: bake_cli-0.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for bake_cli-0.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d932fc3e3e366fe8c730cbcb6238a80d664d50f0dab552649729029f81043d23
MD5 ac42be7d3628a9ce2fb82c763828d7e0
BLAKE2b-256 7fc41e41a8a0028b6bfd57a72336838c5ef250c4600116457c002dfa5fda3ad9

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page