ia_dev/ai_working_help/notary-ai/list-pending-notary-ai.sh
2026-03-16 16:38:55 +01:00

20 lines
872 B
Bash
Executable File

#!/usr/bin/env bash
# List pending JSON files in projects/<slug>/data/notary-ai/pending/.
# Run from repo root (parent of ia_dev). Output: one path per line.
# Usage: depuis la racine de ia_dev (MAIL_TO ou AI_AGENT_TOKEN défini) : ./ai_working_help/notary-ai/list-pending-notary-ai.sh
set -euo pipefail
NOTARY_AI_DIR="${NOTARY_AI_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
export NOTARY_AI_DIR
ROOT="$(cd "${NOTARY_AI_DIR}/../../.." && pwd)"
cd "$ROOT"
# shellcheck source=lib.sh
source "${NOTARY_AI_DIR}/lib.sh"
if [[ -z "${DATA_NOTARY_AI_PENDING_DIR:-}" || ! -d "${DATA_NOTARY_AI_PENDING_DIR}" ]]; then
echo "[notary-ai] DATA_NOTARY_AI_PENDING_DIR not set or not a directory. Set MAIL_TO or AI_AGENT_TOKEN so project id is resolved (no fallback)." >&2
exit 1
fi
for f in "${DATA_NOTARY_AI_PENDING_DIR}"/*.json; do
[[ -f "$f" ]] || continue
echo "$f"
done