Apply shellcheck recommendations

This commit is contained in:
Benoit S 2021-08-29 09:51:15 +09:00
parent 5bd2b9a9c1
commit e162208168

View file

@ -81,7 +81,7 @@ accounts_cull() {
curl \ curl \
--silent \ --silent \
--show-error \ --show-error \
--max-time $INSTANCE_LAST_CHANCE_TIMEOUT \ --max-time "$INSTANCE_LAST_CHANCE_TIMEOUT" \
https://"${instance}" \ https://"${instance}" \
|| error=true || error=true
if $error; then if $error; then
@ -103,19 +103,19 @@ cache_recount(){
media_remove(){ media_remove(){
$DRY_RUN && $TOOTCTL media remove --days $MEDIA_REMOVE_DAYS --concurrency "$DB_POOL" --dry-run $DRY_RUN && $TOOTCTL media remove --days "$MEDIA_REMOVE_DAYS" --concurrency "$DB_POOL" --dry-run
$DRY_RUN || $TOOTCTL media remove --days $MEDIA_REMOVE_DAYS --concurrency "$DB_POOL" $DRY_RUN || $TOOTCTL media remove --days "$MEDIA_REMOVE_DAYS" --concurrency "$DB_POOL"
$DRY_RUN && $TOOTCTL media remove-orphans --dry-run $DRY_RUN && $TOOTCTL media remove-orphans --dry-run
$DRY_RUN || $TOOTCTL media remove-orphans $DRY_RUN || $TOOTCTL media remove-orphans
$DRY_RUN && $TOOTCTL preview_cards remove --days $MEDIA_REMOVE_DAYS --concurrency "$DB_POOL" --dry-run $DRY_RUN && $TOOTCTL preview_cards remove --days "$MEDIA_REMOVE_DAYS" --concurrency "$DB_POOL" --dry-run
$DRY_RUN || $TOOTCTL preview_cards remove --days $CARDS_REMOVE_DAYS --concurrency "$DB_POOL" --link $DRY_RUN || $TOOTCTL preview_cards remove --days "$CARDS_REMOVE_DAYS" --concurrency "$DB_POOL" --link
} }
statuses_remove(){ statuses_remove(){
$DRY_RUN && echo 'Not removing old statuses in dry-run.' $DRY_RUN && echo 'Not removing old statuses in dry-run.'
$DRY_RUN || $TOOTCTL statuses remove --days $STATUSES_REMOVE_DAYS $DRY_RUN || $TOOTCTL statuses remove --days "$STATUSES_REMOVE_DAYS"
} }
$DO_ACCOUNTS_CULL && accounts_cull $DO_ACCOUNTS_CULL && accounts_cull