Skip to content

fix(cli): avoid initializing the store for read-only commands#47

Merged
luca-ctx merged 1 commit into
ctxrs:mainfrom
atharva-patill:fix/read-only-show-locate
Jul 4, 2026
Merged

fix(cli): avoid initializing the store for read-only commands#47
luca-ctx merged 1 commit into
ctxrs:mainfrom
atharva-patill:fix/read-only-show-locate

Conversation

@atharva-patill

@atharva-patill atharva-patill commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Before

ctx locate created work.sqlite even though the store wasn't initialized.

Screenshot 2026-07-04 at 2 12 32 PM

After

ctx locate now reports that the store isn't initialized and no work.sqlite is created.

Screenshot 2026-07-04 at 2 14 57 PM

Reproduction

tmp=$(mktemp -d)

CTX_ANALYTICS_OFF=1 \
CTX_DATA_ROOT="$tmp/data" \
./target/debug/ctx locate event deadbeef

find "$tmp" -maxdepth 2 -type f | sort

Before this change, work.sqlite was created even though the command was read-only.

After this change, the command reports that the store is not initialized and no database is created.

@luca-ctx luca-ctx merged commit 9f80e32 into ctxrs:main Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants