Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addressed some of the shellcheck whinings -- primarily to not declare…
… and assign at the same time Also made that script executable since it is a script with shebang -- should be good like that Here is exemplar list of complaints from shellcheck. Not sure if "local" was actually needed here. The mapfile ones are still to be done In contrib/incremental_backup/dump.sh line 82: LIST+=($(echo "$CHANNEL_LIST_JSON" | $JQ_B -r 'map(select(.is_im == true)) | .[] | .user, .id')) ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In contrib/incremental_backup/dump.sh line 127: local META_JSON=$(<"$META_FILE") ^-------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In contrib/incremental_backup/dump.sh line 129: local PREVIOUS_DATE="$(echo "$META_JSON" | $JQ_B -r '.last_updated | select(. != null)')" ^-----------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In contrib/incremental_backup/dump.sh line 156: local NEW_MESSAGE_COUNT=$($JQ_B -r '.messages | length' "$CHANNEL_FILE") ^---------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In contrib/incremental_backup/dump.sh line 165: local MERGED_CONTENT=$($JQ_B -s '.[0] as $o1 | .[1] as $o2 | ($o1 + $o2) | .messages = ($o1.messages + $o2.messages)' "$CHANNEL_FILE_OLD" "$CHANNEL_FILE") ^------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^-- SC2016 (info): Expressions don't expand in single quotes, use double quotes for that. In contrib/incremental_backup/dump.sh line 174: local TOTAL_MESSAGE_COUNT=$($JQ_B -r '.messages | length' "$CHANNEL_FILE") ^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In contrib/incremental_backup/dump.sh line 190: LIST+=( $(im_channels) ) ^------------^ SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In contrib/incremental_backup/dump.sh line 192: LIST+=( $(group_channels) ) ^---------------^ SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting).
- Loading branch information