fix(issue): fix shell issue which ware found by shellcheck

This commit is contained in:
guzhongren 2022-01-22 15:51:14 +08:00
parent e19896e3a0
commit 48f3917716
No known key found for this signature in database
GPG Key ID: D18AEC180356622D
2 changed files with 8 additions and 6 deletions

View File

@ -1,10 +1,10 @@
#!/bin/sh -l #!/bin/sh
# shellcheck disable=SC3060
set -e # if a command fails it stops the execution set -e # if a command fails it stops the execution
set -u # script fails if trying to access to an undefined variable set -u # script fails if trying to access to an undefined variable
echo "[+] Action start" echo "[+] Action start"
SOURCE_BEFORE_DIRECTORY="${1}"
SOURCE_DIRECTORY="${2}" SOURCE_DIRECTORY="${2}"
DESTINATION_GITHUB_USERNAME="${3}" DESTINATION_GITHUB_USERNAME="${3}"
DESTINATION_REPOSITORY_NAME="${4}" DESTINATION_REPOSITORY_NAME="${4}"

View File

@ -1,11 +1,13 @@
#!/bin/sh -l #!/bin/sh
# shellcheck disable=SC2044
set -euo pipefile set -eu pipefile
rc=0 rc=0
for filename in $(find ./* -name '*.sh'); do for filename in $(find ./* -name '*.sh'); do
echo "Validating" echo "Start to validating ${filename}"
shellcheck "${filename}" || exit $? shellcheck "${filename}" || exit $?
echo "🚀Successfully Validated ${filename}"
done done
exit $? exit $rc