Skip to content
Source
Sign inSign up
pingdotgg/t3code

🐛 fix: prevent checkpoint timeout when running from home directory #1228

Closedmokbhai(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/1228/headopened View on GitHub

Showing 1 changed file with 32 additions and 11 deletions.

x
0 of 1 viewed, 1 left
32 additions and 11 deletionsapps/server/src/checkpointing/Layers/CheckpointStore.tsModified
View file
@@ -10,6 +10,7 @@
* @module CheckpointStoreLive
*/
import { randomUUID } from "node:crypto";
+import { homedir } from "node:os";
​
import { Effect, Layer, FileSystem, Path } from "effect";
​
@@ -25,6 +26,11 @@
const path = yield* Path.Path;
const git = yield* GitService;
​
+ const isHomeDirectory = (cwd: string): boolean => {
+ const home = homedir();
+ return cwd === home;
+ };
+​
const resolveHeadCommit = (cwd: string): Effect.Effect<string | null, GitCommandError> =>
git
.execute({
@@ -75,22 +81,37 @@
);
​
const isGitRepository: CheckpointStoreShape["isGitRepository"] = (cwd) =>
- git
- .execute({
- operation: "CheckpointStore.isGitRepository",
- cwd,