Skip to content

fix: SC2015 A&&B||C anti-pattern in bin/deploy.sh #466

Description

@superdav42

Quality Debt: ShellCheck SC2015

Source: Daily quality sweep 2026-03-25
File: bin/deploy.sh
Severity: Error (SC2015)

Finding

Note that A && B || C is not if-then-else. C may run when A is true. [SC2015]

The A && B || C pattern is not equivalent to if A; then B; else C; fi. If B exits non-zero, C will run unexpectedly. This can cause silent failures in deploy scripts.

Fix

Replace A && B || C patterns with explicit if/then/else blocks:

# Before (buggy)
some_command && success_action || failure_action

# After (correct)
if some_command; then
  success_action
else
  failure_action
fi

Acceptance Criteria

  • All SC2015 violations in bin/deploy.sh replaced with explicit if/then/else
  • shellcheck bin/deploy.sh reports zero SC2015 violations
  • Deploy script behaviour unchanged (test with dry-run if available)

Metadata

Metadata

Assignees

Labels

priority:mediumMedium severity — moderate quality issuequality-debtUnactioned review feedback from merged PRssource:quality-sweepAuto-created by stats-functions.sh quality sweepstatus:queuedWorker dispatched, not yet started

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions