resumecontext 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/projectRoot.js +9 -0
- package/package.json +1 -1
package/dist/projectRoot.js
CHANGED
|
@@ -61,6 +61,15 @@ export function readProjectMarker(root) {
|
|
|
61
61
|
* commands/init.ts for why that's deliberate, not some inferred parent
|
|
62
62
|
* directory). */
|
|
63
63
|
export function writeMarker(root, projectId) {
|
|
64
|
+
// Re-running `init` where this project's marker already exists -- setting
|
|
65
|
+
// up another machine from a clone, or just checking -- leaves the file as
|
|
66
|
+
// it is. createdAt is when the project began: the Cursor importer skips
|
|
67
|
+
// sessions older than it, so resetting it to now would silently drop that
|
|
68
|
+
// machine's earlier sessions, and would dirty a file that is usually
|
|
69
|
+
// committed.
|
|
70
|
+
const existing = readMarker(root);
|
|
71
|
+
if (existing?.projectId === projectId && !Number.isNaN(Date.parse(existing.createdAt)))
|
|
72
|
+
return existing;
|
|
64
73
|
const marker = { projectId, createdAt: new Date().toISOString() };
|
|
65
74
|
fs.writeFileSync(path.join(root, MARKER_FILENAME), JSON.stringify(marker, null, 2) + "\n");
|
|
66
75
|
return marker;
|