scripts/resolve-blender-url.sh, resolve-godot-version.sh, and test-lib.sh were committed as mode 644 (Windows checkouts don't preserve the git exec bit, and it was never set). publish.yml invokes the first two as ./scripts/resolve-*.sh, which needs it — the runner failed with "Permission denied". lib.sh stays 644, it's only sourced. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
36 lines
1.7 KiB
Bash
Executable File
36 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Offline smoke test for lib.sh's parsing logic (no network). Run: ./scripts/test-lib.sh
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
. ./lib.sh
|
|
|
|
fail() { echo "FAIL: $1" >&2; exit 1; }
|
|
|
|
# parse_latest_godot_tag: skips prereleases and drafts, strips "-stable"
|
|
# (needs jq — present on the CI runner; skipped here if this machine lacks it)
|
|
if command -v jq >/dev/null 2>&1; then
|
|
got=$(printf '%s' '[
|
|
{"tag_name":"4.8-rc1","prerelease":true,"draft":false},
|
|
{"tag_name":"4.7.1-stable","prerelease":false,"draft":false},
|
|
{"tag_name":"4.7-stable","prerelease":false,"draft":false},
|
|
{"tag_name":"4.8-dev-draft","prerelease":false,"draft":true}
|
|
]' | parse_latest_godot_tag)
|
|
[ "$got" = "4.7.1" ] || fail "parse_latest_godot_tag: got '$got', want 4.7.1"
|
|
else
|
|
echo "skip: parse_latest_godot_tag (jq not installed on this machine)" >&2
|
|
fi
|
|
|
|
# parse_latest_blender_minor: numeric sort, not lexicographic ("4.10" > "4.2")
|
|
got=$(printf '%s' '<a href="Blender3.6/">Blender3.6/</a> <a href="Blender4.2/">Blender4.2/</a> <a href="Blender4.10/">Blender4.10/</a>' \
|
|
| parse_latest_blender_minor)
|
|
[ "$got" = "4.10" ] || fail "parse_latest_blender_minor: got '$got', want 4.10"
|
|
|
|
# parse_latest_blender_tarball: newest patch, ignores sha256 sidecars and other OSes
|
|
got=$(printf '%s' '<a href="blender-4.2.1-linux-x64.tar.xz">x</a>
|
|
<a href="blender-4.2.10-linux-x64.tar.xz">x</a>
|
|
<a href="blender-4.2.10-linux-x64.tar.xz.sha256">x</a>
|
|
<a href="blender-4.2.10-windows-x64.zip">x</a>' | parse_latest_blender_tarball)
|
|
[ "$got" = "blender-4.2.10-linux-x64.tar.xz" ] || fail "parse_latest_blender_tarball: got '$got', want blender-4.2.10-linux-x64.tar.xz"
|
|
|
|
echo "ok: scripts/lib.sh"
|