mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
core: add project update timestamps to track when projects were last modified
Projects now track when they were last updated, making it easier for users to see recent activity and identify stale projects in their workspace.
This commit is contained in:
parent
c4401290db
commit
036f5d4eef
1 changed files with 5 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ export namespace Project {
|
|||
vcs: z.literal("git").optional(),
|
||||
time: z.object({
|
||||
created: z.number(),
|
||||
updated: z.number().optional(),
|
||||
initialized: z.number().optional(),
|
||||
}),
|
||||
})
|
||||
|
|
@ -38,6 +39,7 @@ export namespace Project {
|
|||
vcs: Info.shape.vcs.parse(Flag.OPENCODE_FAKE_VCS),
|
||||
time: {
|
||||
created: Date.now(),
|
||||
updated: Date.now(),
|
||||
},
|
||||
}
|
||||
await Storage.write<Info>(["project", "global"], project)
|
||||
|
|
@ -84,12 +86,15 @@ export namespace Project {
|
|||
await migrateFromGlobal(projectID, worktree)
|
||||
}
|
||||
const project: Info = {
|
||||
...existing,
|
||||
id: projectID,
|
||||
worktree,
|
||||
vcsDir,
|
||||
vcs: "git",
|
||||
time: {
|
||||
created: Date.now(),
|
||||
...existing?.time,
|
||||
updated: Date.now(),
|
||||
},
|
||||
}
|
||||
await Storage.write<Info>(["project", projectID], project)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue