

GitHub - kennethreitz/bake: Bake — the strangely familiar task runner.
source link: https://github.com/kennethreitz/bake
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
$ 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 abritrary 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 inherinted 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.
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
Fancy, eh?
This repository has been brought to you, with much joy, by Kenneth Reitz.
As above, so below.
Recommend
-
71
Realize - Golang Task Runner
-
70
Today we’ll talk about a miscomfort that has been echoing in my head since a while ago: Task runners fatigue . We’ve come accross Grunt, Gradle, Gulp, NPM scripts, then rediscovered makefiles,...
-
12
Advanced Basics: Using Task Runner in Visual Studio 2019 If the world is running on JavaScript, why not automate your client-side tasks through Visual Studio's Task Runner? Written by Jonathan Danylko • Last Updated: Janu...
-
8
Checked or unchecked? Strangely worded Safari preference! S Sa...
-
11
Emacs Taskrunner This is an elisp library which aims to provide a way to retrieve all of the tasks/targets from various build systems and execute them in a compilation buffer. The ultimate goal is to use this library to prov...
-
7
Microsoft strangely backtracks on decision to block Office macros by default...
-
17
Are your Samsung Galaxy S23 photos strangely blurry? You aren’t alone By Hamish Hector...
-
11
Interstellar Object 'Oumuamua Probably Moved Strangely Due To Gas, Study Says Catch up on stories from the past week (and beyond) at the
-
12
WhatsApp backup smaller, strangely. Anyone else? ...
-
7
Feb 13, 2024 — 15:03 CUT Vision Pro App Spotlight: Things for visionOS Is a Familiar, Intuitive Task Management Experience
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK