{"body":"#!/bin/bash\n...\n\n# Determine platform & init vars\ncumulative_RC=0\nOS=$(uname)\nif [[ $OS =~ Darwin ]]; then # MacOS(X)\n    systemctl=\"launchctl\"\n    sudo=\"sudo\"\n    ln=\"ln -nfs\"\n    gsed=\"gsed\" # installed via (home)brew\n    shellcheck_dir=\"utilities/shellcheck/macos/\"\nelif [[ $OS =~ CYGWIN ]]; then\n    systemctl=\"sc.exe\"\n    sudo=\"\"\n    ln=\"winln -fs\"\n    gsed=\"sed\"\n    shellcheck_dir=\"utilities/shellcheck/windows/\"\nelif [[ $OS =~ Linux ]]; then\n    systemctl=\"sytemctl\"\n    sudo=\"sudo\"\n    ln=\"ln -nfs\"\n    gsed=\"sed\"\n    shellcheck_dir=\"utilities/shellcheck/linux/\"\nelse\n    echo 'x Error, unknown platform \"'$OS'\", only MacOS (Darwin), Windows (via CYGWIN), and Linux currently supported!'\n    exit 2\nfi;\nfiles_to_check=$(git status --porcelain | egrep '^M.*' | egrep '\\.*sh$' | awk '{ print $2}')\nfor i in \"${files_to_check[@]}\"; do\n    \"${shellcheck_dir}\"/shellcheck -S error \"${i}\"\n    cumulative_RC=$((RC+$?))\ndone;\nif [[ \"${cumulative_RC}\" -ne 0 ]]; then\n    echo 'x Error, one or more files failed shellcheck!  See output above.  Failing commit with cumulative_RC = '${cumulative_RC}\n    exit \"${cumulative_RC}\"\nfi;","name":"pre-commit","extension":"sh","url":"https://www.irccloud.com/pastebin/BpumQpEw/pre-commit","modified":1690417762,"id":"BpumQpEw","size":1128,"lines":37,"own_paste":false,"theme":"","date":1690417762}