Giter Club home page Giter Club logo

bake's Introduction

bake— Kinda like Bash & Make, combined.

I love using Makefiles for one-off tasks in projects. The problem with doing this, is you can't use familiar bash–isms when doing so, as GNU Make doesn't use the familiar Bash sytnax. This project seeks to bridge these works.

WORK IN PROGRESS

$ bake -h
Usage: bake [OPTIONS] [TASK] [ARGUMENTS]...

  bake — the familiar Bash/Make hybrid.

Options:
  -b, --bakefile PATH      Custom path to a Bakefile.
  -l, --list               Lists available tasks from Bakefile.
  --whitelist TEXT         Whitelist an environment variable for
                           use.
  --yes                    Set medium–security prompts to yes.
  -x, --fail               Fail immediately, if any task fails.
  --insecure               Use parent shell's environment variables.
  --no-color               Disable colors.
  -s, --silent             Reduce output.
  -j, --environ-json TEXT  Environment variables, in JSON format.
  -h, --help               Show this message and exit.

bake icon

Example Bakefile, for use with bake:

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

argv-example:
    set -eux
    echo "HELLO, $WHO"
    echo $@

dangerous-example: @confirm:secure
    # This will make you do a
    # simple math question before proceeding.
    rm -fr *

python-deps:
    pipenv install
node-deps:
    yarn install

system-deps:
    brew install pipenv

Running the above Bakefile:

$ bake
 - format
 - full-install
 - install
 - env
 - argv-example
 - dangerous-example
 - python-deps
 - node-deps
 - system-deps


$ bake --silent format
All done! ✨ 🍰 ✨
7 files left unchanged.


$ 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 argv-example WHO=you 1 2 3
 · Executing 'argv-example':
++ echo 'HELLO, you'
HELLO, you
++ echo '[1,' 2, '3]'
[1, 2, 3]
 · Done.


$ bake dangerous-example
· Executing '@confirm:secure' ·
   What is 10 times 2?: 7
· Aborted.

Features

  • a Bakefile, which looks and feels like the good parts of a Makefile.
  • except, you can write real bash code!
  • Unlike Makefile, either tabs or 4 spaces can be used.

Installation

Install bake via:

$ brew install kennethreitz/-/bake --HEAD

bake's People

Contributors

kennethreitz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.