Skip to content

Instantly share code, notes, and snippets.

@nweldev
nweldev / better-shellcheck.sh
Last active October 22, 2021 13:58
Lint Unix shell scripts (with autofix)
#!/usr/bin/env bash
## Usage: shellcheck.sh [fix] [path to file]
# name of all the directories that should be ignored
IGNORED_DIR_NAMES=("node_modules" "venv" "reports")
# find options for ignoring directories
IGNORE_PARAM=$(for i in "${!IGNORED_DIR_NAMES[@]}"; do
echo -n "-name ${IGNORED_DIR_NAMES[$i]} ";