In a Project

In a Project: The Scripts Every Project Has, Secrets and .env Files, Git Hooks: Scripts Git Runs for You.

Updated

  1. The Scripts Every Project Has (Journeyman): Most software projects keep a few small scripts for the same four jobs: setup.sh gets a computer ready, dev.sh runs the project while you work, test.sh checks it and deploy.sh puts it live, and setup.sh checks its tools first with command -v.
  2. Secrets and .env Files (Journeyman): A secret such as a token or an API key never goes in a script: it goes in a .env file beside the project, which the script loads with set -a and source, which Git is told to ignore, and which chmod 600 keeps private to you.
  3. Git Hooks: Scripts Git Runs for You (Freelancer): A Git hook is a script Git runs at a set moment: a pre-commit hook in .git/hooks runs before every commit, and when it ends with an exit code other than 0, the commit is stopped, so test.sh and ShellCheck run without anyone having to remember them.