Files
git.taskfile.build/README.md
T

20 KiB

layout, permalink
layout permalink
layouts/base.njk /

./task

Run any project.

Vercel


The task file is a simple bash script and standardized interface for all software projects.

It is to be understood as a software development pattern to standardize the installation, configuration and execution of different software frameworks.

Specification

The specification is a short guide to set up a task file for a Python project.

  • Create a file task in your project.
touch task
  • Ensure it is executable.
chmod +x task
  • First add the bash shebang.
#!/bin/bash
  • Then append the abort on error setting.
set -e
  • Load environment variables from the .env file.
if [[ -a ".env" ]]; then
    source .env
fi
  • Add a help function.
function help-table() {
    CMD_WIDTH=10
    OPT_WIDTH=6
    DESC_WIDTH=40
    COLUMN="| %-${CMD_WIDTH}s | %-${OPT_WIDTH}s | %-${DESC_WIDTH}s |\n"
    printf "$COLUMN" "Command" "Option" "Description"
    echo "|$(printf '%*s' $((CMD_WIDTH + 2)) '' | tr ' ' '-')|$(printf '%*s' $((OPT_WIDTH + 2)) '' | tr ' ' '-')|$(printf '%*s' $((DESC_WIDTH + 2)) '' | tr ' ' '-')|"
    printf "$COLUMN" "all" ""