Skip to content

Commit 668df0f

Browse files
committed
feat(scripts): reset nx cache when lockfile is outdated
1 parent 7e67bdf commit 668df0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/verify-lockfile.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import * as Command from "@effect/platform/Command";
44
import * as CommandExecutor from "@effect/platform/CommandExecutor";
55
import { Effect } from "effect";
66

7-
const command = Command.make("git", "diff", "HEAD@{1}", "--stat", "--", "./pnpm-lock.yaml");
87
const program = Effect.gen(function*() {
9-
const executor = yield* CommandExecutor.CommandExecutor;
10-
const output = yield* executor.lines(command);
11-
if (output.length === 0) {
8+
const ce = yield* CommandExecutor.CommandExecutor;
9+
const diffOutput = yield* ce.lines(Command.make("git", "diff", "HEAD@{1}", "--stat", "--", "./pnpm-lock.yaml"));
10+
if (diffOutput.length === 0) {
1211
return;
1312
}
13+
yield* Effect.log(yield* ce.string(Command.make("pnpm", "nx", "reset")));
1414
yield* Effect.logWarning("Detected changes in pnpm-lock.yaml!");
1515
yield* Effect.logWarning("Please run `pnpm install --fix-lockfile && pnpm dedupe` to update local dependencies.");
1616
});

0 commit comments

Comments
 (0)