-
-
Notifications
You must be signed in to change notification settings - Fork 834
Expand file tree
/
Copy pathvite7.ts
More file actions
21 lines (15 loc) · 702 Bytes
/
vite7.ts
File metadata and controls
21 lines (15 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { execSync } from "node:child_process";
import { readFileSync, writeFileSync } from "node:fs";
import { resolve } from "node:path";
const workspacePath = resolve(import.meta.dirname, "../pnpm-workspace.yaml");
const workspace = readFileSync(workspacePath, "utf8");
const updated = workspace.replace(/^(\s*)#\s*"vite":\s*"\^7"/m, '$1"vite": "^7"');
if (updated === workspace) {
throw new Error('Could not find commented `# "vite": "^7"` line in pnpm-workspace.yaml');
}
writeFileSync(workspacePath, updated);
console.log('Uncommented "vite": "^7" in pnpm-workspace.yaml');
execSync("pnpm install --no-frozen-lockfile", {
stdio: "inherit",
cwd: resolve(import.meta.dirname, ".."),
});