Skip to content

Commit

Permalink
Fixed most warnings from Shellcheck scans. (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtesta committed Sep 5, 2023
1 parent 38f9c21 commit 953683a
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 152 deletions.
16 changes: 9 additions & 7 deletions build_windows_executable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
PLATFORM="$(uname -s)"

# This script is intended for use on Cygwin only.
case "$PLATFORM" in
case "${PLATFORM}" in
CYGWIN*) ;;
*)
echo "Platform not supported ($PLATFORM). This must be run in Cygwin only."
echo "Platform not supported (${PLATFORM}). This must be run in Cygwin only."
exit 1
;;
esac
Expand Down Expand Up @@ -78,13 +78,14 @@ git checkout src/ssh_audit/globals.py 2> /dev/null

# Update the man page.
./update_windows_man_page.sh
if [[ $? != 0 ]]; then
retval=$?
if [[ ${retval} != 0 ]]; then
echo "Failed to run ./update_windows_man_page.sh"
exit 1
fi

# Do all operations from this point from the main source directory.
pushd src/ssh_audit > /dev/null
pushd src/ssh_audit || exit > /dev/null

# Delete the existing VERSION variable and add the value that the user entered, above.
sed -i '/^VERSION/d' globals.py
Expand All @@ -109,8 +110,9 @@ else
fi

# Ensure that the version string doesn't have '-dev' in it.
X=`dist/ssh-audit.exe | grep -E 'ssh-audit.exe v.+\-dev'` > /dev/null
if [[ $? == 0 ]]; then
dist/ssh-audit.exe | grep -E 'ssh-audit.exe v.+\-dev' > /dev/null
retval=$?
if [[ ${retval} == 0 ]]; then
echo -e "\nError: executable's version number includes '-dev'."
exit 1
fi
Expand All @@ -121,5 +123,5 @@ rm -rf build/ ssh-audit.spec ssh-audit.py
# Reset the changes we made to globals.py.
git checkout globals.py 2> /dev/null

popd > /dev/null
popd || exit > /dev/null
exit 0
Loading

0 comments on commit 953683a

Please sign in to comment.