Check the app's icon: say when it can't be used, refuse it on publish
An icon.png that's missing, a link, over 1 MB or not a PNG used to become the default silently. The installer and coreapp deploy now say so (and note icons that aren't square or are small); coreapp publish refuses an unusable or uncommitted one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -89,7 +89,7 @@ core_domain() {
|
||||
# --- The app in the current folder ---------------------------------------
|
||||
|
||||
# From coreapp.toml, as checked by the installer
|
||||
NAME="" TITLE="" VERSION="" IMAGE="" PORT="" HEALTH="" NEEDS=""
|
||||
NAME="" TITLE="" VERSION="" IMAGE="" PORT="" HEALTH="" NEEDS="" ICON="" ICON_NOTE=""
|
||||
load_app() {
|
||||
load_manifest
|
||||
init_core
|
||||
@@ -110,6 +110,8 @@ load_manifest() {
|
||||
port) PORT="$value" ;;
|
||||
health) HEALTH="$value" ;;
|
||||
needs) NEEDS="$value" ;;
|
||||
icon) ICON="$value" ;;
|
||||
icon_note) ICON_NOTE="$value" ;;
|
||||
esac
|
||||
done <<< "$values"
|
||||
}
|
||||
@@ -220,6 +222,8 @@ cmd_deploy() {
|
||||
*) die "Usage: coreapp deploy [--recreate]" ;;
|
||||
esac
|
||||
load_app
|
||||
# (The installer tells about an icon it can't use)
|
||||
[[ "$ICON" != ok || -z "$ICON_NOTE" ]] || echo "Note: $ICON_NOTE"
|
||||
|
||||
echo "Updating the installer on the Core ($REMOTE_INSTALLER)..."
|
||||
sync_installer
|
||||
@@ -456,6 +460,12 @@ coreapp deploy keeps working with that name."
|
||||
|| die "This folder isn't a git repository. A published app is one (its tag is the release)."
|
||||
[[ -z "$(git status --porcelain)" ]] \
|
||||
|| die "There are uncommitted changes (git status). Commit them first, so the release matches a commit."
|
||||
# The Core reads icon.png from the repository at the tag
|
||||
[[ "$ICON" != bad ]] || die "$ICON_NOTE Fix it before publishing: a release can't be changed."
|
||||
if [[ "$ICON" == ok ]] && ! git ls-files -s icon.png | grep -q '^100644 '; then
|
||||
die "icon.png isn't in the repository (is it in .gitignore?), so Cores would show the default icon. Commit it first."
|
||||
fi
|
||||
[[ -z "$ICON_NOTE" ]] || echo "Note: $ICON_NOTE"
|
||||
commit="$(git rev-parse HEAD)"
|
||||
if git rev-parse -q --verify "refs/tags/$tag" > /dev/null; then
|
||||
[[ "$(git rev-parse "$tag^{commit}")" == "$commit" ]] \
|
||||
|
||||
Reference in New Issue
Block a user