-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
For a better, faster, safer user experience:
- RETAIN A SMOOTH LEARNING CURVE (KISS)
- write out the principles behind the project (commit)
- run tests for all these
- use printf instead of echo (why)
- use pushd/popd over cd (why)
- warn user when running as root (commit)
- ensure variables are set using set -o nounset
- quote arguments that might have spaces
- critical sections should use traps
- actions be atomic
- perform static analysis (commit)
- use [ in place of [[ for portability
- use #!/usr/bin/env bash over #!/bin/bash
- set magic variables e.g. for current file, basename, and directory
- use set -o xtrace for debugging
- use set -o pipefail for errors in pipes
- use set -o errexit for exiting when error occurs
- avoid using eval as much as necessary (used here) (do a search)
- minimal dependencies (issues: check dependencies during msu installation #16)
- use semantic versioning
- maintain a changelog
Useful articles/tools:
- Writing robust shell scripts
- Shellcheck: Static Analysis
- [What is the difference between test, [ and [ ?
- Best Practices for Writing Bash Scripts
- Keep a Changelog
- Bash Shell Scripting