fix: Asset-Sync auf macOS lauffaehig
- mapfile/stat -c sind GNU-spezifisch und fehlen in macOS-Bash 3.2 - Manifest-Zeilen jetzt per while-read, Dateigroesse portabel (stat -c bzw. stat -f), Hash ueber sha256sum oder shasum -a 256 - Godot-Fallback auf /Applications/Godot.app, wenn der Linux-Pfad fehlt - --check und --sync auf macOS verifiziert (1193 Assertions gruen)
This commit is contained in:
parent
3a7233bea4
commit
0db58df6b5
1 changed files with 22 additions and 5 deletions
|
|
@ -15,6 +15,9 @@ PROJECT_DIR="$REPO_ROOT/rinkplanner"
|
|||
MANIFEST="$PROJECT_DIR/assets/asset_manifest.json"
|
||||
WORKBENCH="${RINKPLANNER_WORKBENCH:-$HOME/Documents/workbench_rinkplanner}"
|
||||
GODOT="${GODOT:-/opt/godot/Godot_v4.7.2-stable_linux.x86_64}"
|
||||
if [[ ! -x "$GODOT" && -x "/Applications/Godot.app/Contents/MacOS/Godot" ]]; then
|
||||
GODOT="/Applications/Godot.app/Contents/MacOS/Godot"
|
||||
fi
|
||||
CREDENTIALS_FILE="${RINKPLANNER_CREDENTIALS:-$REPO_ROOT/docs/credentials.txt}"
|
||||
|
||||
MODE="check"
|
||||
|
|
@ -192,7 +195,10 @@ remote_upload() {
|
|||
|
||||
# --- Manifest lesen ----------------------------------------------------------
|
||||
|
||||
mapfile -t rows < <(python3 - "$MANIFEST" <<'PY'
|
||||
rows=()
|
||||
while IFS= read -r row; do
|
||||
[[ -n "$row" ]] && rows+=("$row")
|
||||
done < <(python3 - "$MANIFEST" <<'PY'
|
||||
import json
|
||||
import sys
|
||||
|
||||
|
|
@ -217,12 +223,23 @@ if [[ ${#rows[@]} -eq 0 ]]; then
|
|||
fi
|
||||
|
||||
file_size() {
|
||||
stat -c '%s' "$1"
|
||||
local size
|
||||
if size="$(stat -c '%s' "$1" 2>/dev/null)"; then
|
||||
printf '%s' "$size"
|
||||
else
|
||||
stat -f '%z' "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
file_sha() {
|
||||
sha256sum "$1" | cut -d' ' -f1
|
||||
}
|
||||
if command -v sha256sum >/dev/null 2>&1; then
|
||||
file_sha() {
|
||||
sha256sum "$1" | cut -d' ' -f1
|
||||
}
|
||||
else
|
||||
file_sha() {
|
||||
shasum -a 256 "$1" | cut -d' ' -f1
|
||||
}
|
||||
fi
|
||||
|
||||
matches_hash() {
|
||||
local path="$1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue