diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 312b633..cf4000d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,17 @@ --- default_stages: [commit] repos: + - repo: local + hooks: + - id: bash-3 + name: macOS default bash version 3.2 + entry: | + bash -c 'set -x + err=$(/bin/bash ./gh-find-code -h 2>&1 >/dev/null) + [[ -n $err ]] && exit 1 || exit 0' + language: system + pass_filenames: false + files: gh-find-code - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: diff --git a/gh-find-code b/gh-find-code index 393bdd6..9d3bb85 100755 --- a/gh-find-code +++ b/gh-find-code @@ -96,6 +96,8 @@ check_version() { # IMPORTANT: Keep it in sync with the readme.md print_help_text() { local help_text + # Note: the quotation mark in '@junegunn‘s' is the unicode char U+02bc, don't use the + # typical single quotation mark, as this would cause the script to fail in bash 3.2 help_text=$( cat <