#!/usr/bin/env bash
# Simulates Codex's atomic cache refresh in a shadow home: write a temp file, rename it over the entry.
set -euo pipefail
SHADOW="$1"
printf '%s\n' '{"version":1,"chatgpt_user_id":"user-work","account_id":"acct-work","bundle":{}}' > "$SHADOW/.cloud-config-bundle-cache.json.tmp"
mv -f "$SHADOW/.cloud-config-bundle-cache.json.tmp" "$SHADOW/cloud-config-bundle-cache.json"
