51 lines
1.6 KiB
Bash
Executable File
51 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# migrate-linux.sh — richtet ~/.config/ai-control auf dieser Maschine so ein,
|
|
# wie es auf dem Mac für das Projekt ai-control steht (übrige Projekte später).
|
|
# Quelle ist das synced Repo ~/claude-projects/pool (CLAUDE.md, settings.json,
|
|
# commands, Runtime) — deshalb: erst pullen, dann ausführen.
|
|
# Überschreibt vorhandene Config; lokale Test-Sessions im Pool werden verworfen.
|
|
set -euo pipefail
|
|
|
|
config="$HOME/.config/ai-control"
|
|
poolrepo="$HOME/claude-projects/pool"
|
|
pooldir="$config/pools/private"
|
|
|
|
mkdir -p "$pooldir"
|
|
|
|
# Projekt-Icons liegen im synced Repo; unter .config nur ein Symlink
|
|
if [ -d "$config/icons" ] && [ ! -L "$config/icons" ]; then rm -rf "$config/icons"; fi
|
|
ln -sfn "$poolrepo/icons" "$config/icons"
|
|
|
|
# App-Settings — wie auf dem Mac
|
|
cat > "$config/settings.json" <<'EOF'
|
|
{
|
|
"claudeCommand": "claude-sync",
|
|
"poolSyncDir": "~/claude-projects/pool"
|
|
}
|
|
EOF
|
|
|
|
# Registry: erst mal nur ai-control
|
|
cat > "$config/projects.json" <<'EOF'
|
|
{
|
|
"ai-control": "~/claude-projects/ai-control"
|
|
}
|
|
EOF
|
|
|
|
# Pool private: Identität + User-Scope aus dem synced Repo
|
|
cat > "$pooldir/pool.json" <<'EOF'
|
|
{
|
|
"name": "private",
|
|
"credentialType": "oauth"
|
|
}
|
|
EOF
|
|
cp "$poolrepo/settings.json" "$pooldir/settings.json"
|
|
cp "$poolrepo/CLAUDE.md" "$pooldir/CLAUDE.md"
|
|
rm -rf "$pooldir/commands"
|
|
cp -R "$poolrepo/commands" "$pooldir/commands"
|
|
|
|
# Runtime (projects/todos/history.jsonl) aufs synced Repo verlinken —
|
|
# damit funktionieren Resume und History maschinenübergreifend
|
|
"$poolrepo/bin/link-pool-runtime" private
|
|
|
|
echo "migriert: $config (Projekt ai-control, Pool private)"
|