Skip to content

Commit fc66b28

Browse files
committed
Small fix
1 parent b6984c4 commit fc66b28

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/link-packages.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ if (!packages.length) {
3131

3232
packages.forEach(unlink ? unlinkPackage : linkPackage)
3333

34+
// After unlinking, restore npm packages with a single pnpm install.
35+
if (unlink && packages.length > 0) {
36+
const srcPath = path.resolve(__dirname, "..", "src")
37+
console.log("\nRestoring npm packages...")
38+
39+
try {
40+
execSync("pnpm install", { cwd: srcPath, stdio: "inherit" })
41+
console.log("Successfully restored npm packages")
42+
} catch (error) {
43+
console.error(`Failed to restore packages: ${error.message}`)
44+
console.log("You may need to run 'pnpm install' manually in the src directory")
45+
}
46+
}
47+
3448
if (!unlink && watch) {
3549
const watchers = packages.filter((pkg) => pkg.watchCommand).map(startWatch)
3650

0 commit comments

Comments
 (0)