diff options
| author | Ben Sima <ben@bensima.com> | 2025-11-22 13:55:28 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-11-22 13:55:28 -0500 |
| commit | 10a2b488519c061eb86c9147cc96b38c82f51ef8 (patch) | |
| tree | 14abeeab9654353259e1baaf8cf462322c58d659 /Omni/Agent/sync-tasks.sh | |
| parent | 8697fd8a11a1cf368db1e6c05afddf87906e8de3 (diff) | |
| parent | 960f7226139abd5408454e5285ead2024e0da643 (diff) | |
task: complete t-rWcqsDZFM.2 (Merge)
Amp-Thread-ID:
https://ampcode.com/threads/T-ca3b086b-5a85-422a-b13d-256784c04221
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'Omni/Agent/sync-tasks.sh')
| -rwxr-xr-x | Omni/Agent/sync-tasks.sh | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Omni/Agent/sync-tasks.sh b/Omni/Agent/sync-tasks.sh deleted file mode 100755 index f4669b7..0000000 --- a/Omni/Agent/sync-tasks.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Omni/Ide/sync-tasks.sh -# Synchronizes the task database with the live branch safely. -# Usage: sync-tasks.sh [--commit] - -COMMIT=0 -if [[ "$1" == "--commit" ]]; then - COMMIT=1 -fi - -REPO_ROOT="$(git rev-parse --show-toplevel)" -cd "$REPO_ROOT" - -echo "Syncing tasks..." - -# 1. Import latest tasks from 'live' branch -# We use git show to get the file content from the reference branch without checking it out -mkdir -p .tasks -git show live:.tasks/tasks.jsonl > .tasks/live-tasks.jsonl - -# 2. Merge logic: Import live tasks into our local DB -# The 'task import' command uses timestamps to resolve conflicts (last write wins) -if [ -s .tasks/live-tasks.jsonl ]; then - echo "Importing tasks from live branch..." - "$REPO_ROOT/_/bin/task" import -i .tasks/live-tasks.jsonl -fi - -# 3. Clean up -rm .tasks/live-tasks.jsonl - -# 4. Export current state to ensure it's clean/deduplicated -"$REPO_ROOT/_/bin/task" export --flush - -# 5. Commit changes to .tasks/tasks.jsonl if requested and there are changes -if [[ "$COMMIT" -eq 1 ]]; then - if [[ -n $(git status --porcelain .tasks/tasks.jsonl) ]]; then - echo "Committing task updates..." - git add .tasks/tasks.jsonl - git commit -m "task: sync database" || true - echo "Task updates committed to current branch." - else - echo "No task changes to commit." - fi -fi |
