-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_archcode.sh
More file actions
38 lines (29 loc) · 1.16 KB
/
Copy pathinit_archcode.sh
File metadata and controls
38 lines (29 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -e
echo "🔧 Initialisation de .archcode/"
ARCHCODE_DIR=".archcode"
ARCHIVE_DIR="$ARCHCODE_DIR/archive"
MEMORY_DIR="$ARCHCODE_DIR/memory"
mkdir -p "$ARCHIVE_DIR"
mkdir -p "$MEMORY_DIR"
# Fichiers YAML/JSON initiaux (créés s'ils n'existent pas déjà)
touch_if_absent() {
local path="$1"
local default="$2"
if [ ! -f "$path" ]; then
echo -e "$default" > "$path"
echo "✅ $path créé"
else
echo "ℹ️ $path déjà présent, ignoré"
fi
}
# YAMLs de base
touch_if_absent "$ARCHCODE_DIR/rollback_bundle.yaml" "# rollback_bundle — liste des retours arrière\nrollbacks: []"
touch_if_absent "$ARCHCODE_DIR/plan_validated.yaml" "# plan_validated — dernier plan prêt à exécution\nmodules: []"
touch_if_absent "$ARCHCODE_DIR/current_status.yaml" "# current_status — état du dernier run\nstatus: idle"
# JSON vide (dernière trace utile)
touch_if_absent "$ARCHCODE_DIR/last_pb.json" "{}"
# Mémoire (préremplissage possible plus tard)
touch_if_absent "$MEMORY_DIR/memory_index.yaml" "# mémoire\nindex: []"
touch_if_absent "$MEMORY_DIR/memory_cache.json" "{}"
echo "✅ .archcode/ initialisé proprement"