Files
figcraft/packaging/check-app-specific.sh
Dylan M. Taylor 8d790607ff packaging: bash test and function hygiene (SonarCloud S7688, S7679, S7682, S131, S7677) (#1201)
- Use [[ ]] instead of [ ] for conditional tests in the bash packaging scripts (S7688). Every
  converted test compares quoted values to literals, so no pattern-matching change.
- Name positional parameters with locals inside functions (S7679).
- End the env.sh helpers with an explicit return that keeps their exit status (S7682).
- Give case statements a default branch (S131).
- Send the check-app-specific.sh error to stderr (S7677).

packaging/freebsd/package.sh is left alone while #1158 rewrites it.
2026-10-23 11:17:32 -04:00

25 lines
1000 B
Bash

#!/usr/bin/env bash
# App-specific checks retained alongside shared packaging lint.
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
bash packaging/server/install-test.sh
if grep -rniE 'photoshop|psd|photocraft|vectorcraft|illustrator|adobe|figma' packaging/ .github/ \
--exclude=packaging-lint.yml --exclude=check-app-specific.sh; then
echo "::error::package metadata mentions another product (see above)" >&2
exit 1
fi
python3 - <<'PYEOF'
import yaml
manifests = []
for name in ("ai.storyteller.figcraft.yml", "ai.storyteller.figcraft.bundle.yml"):
with open("packaging/linux/flatpak/" + name) as source:
manifest = yaml.safe_load(source)
assert manifest["id"] == "ai.storyteller.figcraft" and manifest["command"] == "figcraft", name
manifests.append(manifest)
for key in ("runtime", "runtime-version", "sdk", "finish-args"):
assert manifests[0][key] == manifests[1][key], f"Flatpak manifests disagree on {key}"
print("FigCraft package identity ok")
PYEOF