Last active
June 12, 2020 12:45
-
-
Save XIIIVI/2daddc1aff7376b6ae3b038fc32082c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# check_bash_syntax | |
# - param1: shell to check | |
# | |
check_bash_syntax() { | |
local SCRIPT=${1} | |
TEST_COUNT=$((TEST_COUNT + 1)) | |
STATUS=$(shellcheck ${SCRIPT} | grep problems | wc -l) | |
if [ "${STATUS}" -le 0 ] | |
then | |
test_succeeded "The ${SCRIPT} has no syntax issue" | |
else | |
test_failed "The ${SCRIPT} has syntax issue" | |
shellcheck ${SCRIPT} | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment