diff --git a/scripts/pull.sh b/scripts/pull.sh index 21dcd99..d11881c 100755 --- a/scripts/pull.sh +++ b/scripts/pull.sh @@ -95,7 +95,8 @@ rsync -a "${DRY[@]}" \ # agents//**/*.md (including {IDENTITY,SOUL,USER,TOOLS}.md at root) OPENCLAW_CONFIG="${OPENCLAW_CONFIG:-$HOME/.openclaw/openclaw.json}" if command -v jq >/dev/null 2>&1 && [[ -f "$OPENCLAW_CONFIG" ]] && [[ -d "$SYNC_REPO_DIR/agents" ]]; then - mapfile -t agent_rows < <(jq -r '.agents.list[] | [.id, (.workspace // "")] | @tsv' "$OPENCLAW_CONFIG") + agent_rows=() + while IFS= read -r row; do agent_rows+=("$row"); done < <(jq -r '.agents.list[] | [.id, (.workspace // "")] | @tsv' "$OPENCLAW_CONFIG") for row in "${agent_rows[@]}"; do agent_id="$(echo "$row" | cut -f1)" agent_ws="$(echo "$row" | cut -f2)" diff --git a/scripts/sync.sh b/scripts/sync.sh index 4f4ace6..d5e715b 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -106,11 +106,13 @@ fi # Use jq if available; fallback to single commit. if command -v jq >/dev/null 2>&1; then - mapfile -t group_names < <(jq -r '.groups[].name' "$GROUPS_JSON") + group_names=() + while IFS= read -r g; do group_names+=("$g"); done < <(jq -r '.groups[].name' "$GROUPS_JSON") for g in "${group_names[@]}"; do commit_msg=$(jq -r ".groups[] | select(.name==\"$g\") | .commitMessage" "$GROUPS_JSON") - mapfile -t paths < <(jq -r ".groups[] | select(.name==\"$g\") | .paths[]" "$GROUPS_JSON") + paths=() + while IFS= read -r p; do paths+=("$p"); done < <(jq -r ".groups[] | select(.name==\"$g\") | .paths[]" "$GROUPS_JSON") # Stage paths if they exist and have changes. staged_any=0