life-todo

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 00d1ff9dd0d9bc89ecb905efc0f853a3170520a5
parent 4d512d7d7bb099284c4ae1746f41da5a8411f631
Author: Michael Percival <m@michaelpercival.xyz>
Date:   Tue, 14 Apr 2026 14:29:52 +0100

Move todo list and conversations to a separate git repo

todo.md and data/conversations/ now live in data/repo/, a separate
git repo pointing at todo-list.git. setup.sh initializes the data
repo and migrates an existing todo.md from the project root.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Diffstat:
M.gitignore | 1+
Mscripts/setup.sh | 28+++++++++++++++++++++++++---
Msrc/git.js | 4++--
Msrc/state.js | 2+-
Msrc/todo.js | 2+-
Dtodo.md | 10----------
6 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,3 +1,4 @@ node_modules/ .env data/ +todo.md diff --git a/scripts/setup.sh b/scripts/setup.sh @@ -34,9 +34,31 @@ echo "Installing npm dependencies..." npm install echo "✓ Dependencies installed" -# Create data directories (gitignored) -mkdir -p data/conversations data/tmp -echo "✓ data directories ready" +# Create tmp directory (gitignored, outside the data repo) +mkdir -p data/tmp +echo "✓ data/tmp directory ready" + +# Set up the data repo (todo list + conversation history) +DATA_REPO="$REPO_ROOT/data/repo" +if [ ! -d "$DATA_REPO/.git" ]; then + echo "Initializing data repo..." + mkdir -p "$DATA_REPO/conversations" + git -C "$DATA_REPO" init + git -C "$DATA_REPO" remote add origin git@michaelpercival.com:/var/www/gitcom/todo-list.git + # Migrate existing todo.md from project root if present + if [ -f "$REPO_ROOT/todo.md" ]; then + mv "$REPO_ROOT/todo.md" "$DATA_REPO/todo.md" + echo " Migrated todo.md from project root" + else + touch "$DATA_REPO/todo.md" + fi + git -C "$DATA_REPO" add . + git -C "$DATA_REPO" commit -m "Initialize todo list repo" + git -C "$DATA_REPO" push -u origin master || echo " WARNING: push failed — check remote access" + echo "✓ Data repo initialized" +else + echo "✓ Data repo already initialized" +fi # Check Python + faster-whisper for voice transcription if ! command -v python3 &>/dev/null; then diff --git a/src/git.js b/src/git.js @@ -1,8 +1,8 @@ const simpleGit = require('simple-git'); const path = require('path'); -const REPO_ROOT = path.join(__dirname, '..'); -const git = simpleGit(REPO_ROOT); +const DATA_REPO = path.join(__dirname, '..', 'data', 'repo'); +const git = simpleGit(DATA_REPO); async function commitAndPush(message) { await git.add('todo.md'); diff --git a/src/state.js b/src/state.js @@ -1,7 +1,7 @@ const fs = require('fs'); const path = require('path'); -const STATE_DIR = path.join(__dirname, '..', 'data', 'conversations'); +const STATE_DIR = path.join(__dirname, '..', 'data', 'repo', 'conversations'); function filePath(userId) { return path.join(STATE_DIR, `${userId}.json`); diff --git a/src/todo.js b/src/todo.js @@ -1,7 +1,7 @@ const fs = require('fs'); const path = require('path'); -const TODO_PATH = path.join(__dirname, '..', 'todo.md'); +const TODO_PATH = path.join(__dirname, '..', 'data', 'repo', 'todo.md'); function read() { if (!fs.existsSync(TODO_PATH)) return ''; diff --git a/todo.md b/todo.md @@ -1,10 +0,0 @@ -# Todo - -## Urgent - -## This Week -- [ ] Do the dishes - -## Someday - -## Done