From 5a2049bd47ca6cc49c916cdc6e3d0a22e528d431 Mon Sep 17 00:00:00 2001 From: Miguel Silvestre Date: Tue, 21 Feb 2017 18:50:13 +0000 Subject: [PATCH] Clean code using shellspeck --- src/commands/git_secret_changes.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/git_secret_changes.sh b/src/commands/git_secret_changes.sh index 11bc88a4..b1ad3c82 100644 --- a/src/commands/git_secret_changes.sh +++ b/src/commands/git_secret_changes.sh @@ -18,15 +18,15 @@ function changes { shift $((OPTIND-1)) [ "$1" = '--' ] && shift - local filenames="$@" - if [[ -z "$filenames" ]]; then + local filenames=( "$@" ) + if [[ ${#filenames[@]} -eq 0 ]]; then # Checking if no filenames are passed, show diff for all files. - filenames=$(git secret list) + filenames=( $(git secret list) ) fi IFS=' ' - for filename in $filenames; do + for filename in "${filenames[@]}"; do local decrypted local content local diff_result