修复模块注入

This commit is contained in:
whyour
2025-10-26 22:32:03 +08:00
parent a1f888af59
commit 07951964a1
11 changed files with 50 additions and 92 deletions
+6 -4
View File
@@ -36,10 +36,12 @@ async function linkCommand() {
const source = path.join(config.rootPath, 'shell', link.src);
const target = path.join(commandDir, link.dest);
const tmpTarget = path.join(commandDir, link.tmp);
const stats = await fs.lstat(tmpTarget);
if (stats) {
await fs.unlink(tmpTarget);
}
try {
const stats = await fs.lstat(tmpTarget);
if (stats) {
await fs.unlink(tmpTarget);
}
} catch (error) { }
await fs.symlink(source, tmpTarget);
await fs.rename(tmpTarget, target);
}