dk-frontend-skills 1.1.1 → 1.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/package.json +1 -1
- package/scripts/copy-skills.js +15 -29
package/package.json
CHANGED
package/scripts/copy-skills.js
CHANGED
|
@@ -282,38 +282,24 @@ if (fs.existsSync(logFile)) {
|
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
// 自动卸载
|
|
285
|
+
// 用 detached 子进程延迟卸载,避免在 npm 生命周期中自卸导致冲突
|
|
285
286
|
console.log("🧹 自动卸载安装包...");
|
|
286
287
|
|
|
287
|
-
|
|
288
|
-
|
|
288
|
+
const uninstallCmd = `
|
|
289
|
+
const { execSync } = require("child_process");
|
|
290
|
+
setTimeout(() => {
|
|
289
291
|
execSync("npm uninstall dk-frontend-skills", {
|
|
290
|
-
cwd: projectRoot,
|
|
292
|
+
cwd: ${JSON.stringify(projectRoot)},
|
|
291
293
|
windowsHide: true,
|
|
292
294
|
stdio: "ignore",
|
|
293
295
|
});
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
execSync("npm uninstall dk-frontend-skills", {
|
|
305
|
-
cwd: ${JSON.stringify(projectRoot)},
|
|
306
|
-
windowsHide: true,
|
|
307
|
-
stdio: "ignore",
|
|
308
|
-
});
|
|
309
|
-
}, 1000);
|
|
310
|
-
`,
|
|
311
|
-
],
|
|
312
|
-
{
|
|
313
|
-
detached: true,
|
|
314
|
-
stdio: "ignore",
|
|
315
|
-
windowsHide: process.platform === "win32",
|
|
316
|
-
},
|
|
317
|
-
);
|
|
318
|
-
child.unref();
|
|
319
|
-
}
|
|
296
|
+
}, 500);
|
|
297
|
+
`;
|
|
298
|
+
|
|
299
|
+
const child = spawn(process.execPath, ["-e", uninstallCmd], {
|
|
300
|
+
cwd: projectRoot,
|
|
301
|
+
detached: true,
|
|
302
|
+
stdio: "ignore",
|
|
303
|
+
windowsHide: process.platform === "win32",
|
|
304
|
+
});
|
|
305
|
+
child.unref();
|