Skip to content

Commit

Permalink
Add list command so we could use before doit in shellcheckit
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Dec 22, 2023
1 parent 35b2a70 commit 2788c19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion shellcheckit
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ fi

source "$(readlink -f "$0" | xargs dirname)/common.sh"

function list() {
git grep -l "$SHEBANG_REGEX" | grep -v '\.\(txt\|md\)'
}

function doit() {
git grep -l "$SHEBANG_REGEX" | grep -v '\.\(txt\|md\)' | xargs shellcheck "$@"
list | xargs shellcheck "$@"
}

function generate_workflow() {
Expand Down Expand Up @@ -57,6 +61,7 @@ EOF

# poor man shortcuts for just doing it using the regex etc
case "${1:-}" in
list) shift; list "$@"; exit $?;;
doit) shift; doit "$@"; exit $?;;
generate_workflow) generate_workflow; exit $?;;
esac
Expand Down

0 comments on commit 2788c19

Please sign in to comment.