Merge pull request #257 from joshrabinowitz/shellcheck-fix

Fixes for new shellcheck error SC2236
pull/256/head^2
Josh Rabinowitz 6 years ago committed by GitHub
commit 898b93b864
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,7 +8,7 @@ if [[ "$GITSECRET_DIST" == "rpm" ]]; then
fi
# if not null GITSECRET_DIST
if [[ ! -z "$GITSECRET_DIST" ]]; then
if [[ -n "$GITSECRET_DIST" ]]; then
# When making a non-container build, this step will generate
# proper manifest files:
make "deploy-$GITSECRET_DIST";

@ -454,13 +454,13 @@ function _find_and_clean_formatted {
local verbose=${2:-""} # can be empty or should be equal to "v"
local message=${3:-"cleaning:"} # can be any string
if [[ ! -z "$verbose" ]]; then
if [[ -n "$verbose" ]]; then
echo && echo "$message"
fi
_find_and_clean "$pattern" "$verbose"
if [[ ! -z "$verbose" ]]; then
if [[ -n "$verbose" ]]; then
echo
fi
}
@ -623,7 +623,7 @@ function _decrypt {
args+=( "--yes" )
fi
if [[ ! -z "$homedir" ]]; then
if [[ -n "$homedir" ]]; then
args+=( "--homedir" "$homedir" )
fi
@ -632,7 +632,7 @@ function _decrypt {
fi
local exit_code
if [[ ! -z "$passphrase" ]]; then
if [[ -n "$passphrase" ]]; then
echo "$passphrase" | $SECRETS_GPG_COMMAND "${args[@]}" --quiet --batch --yes --no-tty --passphrase-fd 0 \
"$encrypted_filename"
exit_code=$?

@ -44,7 +44,7 @@ function changes {
if [[ ! -f "$encrypted_filename" ]]; then
_abort "cannot find encrypted version of file: $filename"
fi
if [[ ! -z "$normalized_path" ]]; then
if [[ -n "$normalized_path" ]]; then
path=$(_append_root_path "$normalized_path")
else
# Path was already normalized

@ -34,7 +34,7 @@ function _optional_delete {
path_mappings=$(_get_secrets_dir_paths_mapping)
# We use custom formatting here:
if [[ ! -z "$verbose" ]]; then
if [[ -n "$verbose" ]]; then
echo && echo 'removing unencrypted files:'
fi
@ -45,7 +45,7 @@ function _optional_delete {
_find_and_clean "*$filename" "$verbose"
done < "$path_mappings"
if [[ ! -z "$verbose" ]]; then
if [[ -n "$verbose" ]]; then
echo
fi
fi

Loading…
Cancel
Save