simplify code (#304)

This commit is contained in:
Reto Kromer 2018-02-09 21:22:31 +01:00 committed by GitHub
parent 8927478efb
commit e2850d38c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
SCRIPT=$(basename "${0}")
VERSION='2017-07-08'
VERSION='2018-02-09'
AUTHOR='ffmprovisr'
RED='\033[1;31m'
BLUE='\033[1;34m'
@ -67,9 +67,8 @@ old_file=$(grep -v '^#' "${input_hash}")
tmp_file=$(grep -v '^#' "${md5_tmp}")
if [[ "${old_file}" = "${tmp_file}" ]]; then
echo -e "${BLUE}'$(basename "${input_file}")' matches '$(basename "${input_hash}")'${NC}"
rm "${md5_tmp}"
else
echo -e "${RED}The following differences were detected between '$(basename "${input_file}")' and '$(basename "${input_hash}")':${NC}"
diff "${input_hash}" "${md5_tmp}"
rm "${md5_tmp}"
fi
rm "${md5_tmp}"

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
SCRIPT=$(basename "${0}")
VERSION='2017-07-08'
VERSION='2018-02-09'
AUTHOR='ffmprovisr'
RED='\033[1;31m'
BLUE='\033[1;34m'
@ -64,9 +64,8 @@ old_file=$(grep -v '^#' "${input_hash}")
tmp_file=$(grep -v '^#' "${md5_tmp}")
if [[ "${old_file}" = "${tmp_file}" ]]; then
echo -e "${BLUE}'$(basename "${input_file}")' matches '$(basename "${input_hash}")'${NC}"
rm "${md5_tmp}"
else
echo -e "${RED}The following differences were detected between '$(basename "${input_file}")' and '$(basename "${input_hash}")':${NC}"
diff "${input_hash}" "${md5_tmp}"
rm "${md5_tmp}"
fi
rm "${md5_tmp}"