mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复 task 命令可能软链失败
This commit is contained in:
@@ -36,6 +36,10 @@ async function linkCommand() {
|
|||||||
const source = path.join(config.rootPath, 'shell', link.src);
|
const source = path.join(config.rootPath, 'shell', link.src);
|
||||||
const target = path.join(commandDir, link.dest);
|
const target = path.join(commandDir, link.dest);
|
||||||
const tmpTarget = path.join(commandDir, link.tmp);
|
const tmpTarget = path.join(commandDir, link.tmp);
|
||||||
|
const stats = await fs.lstat(tmpTarget);
|
||||||
|
if (stats) {
|
||||||
|
await fs.unlink(tmpTarget);
|
||||||
|
}
|
||||||
await fs.symlink(source, tmpTarget);
|
await fs.symlink(source, tmpTarget);
|
||||||
await fs.rename(tmpTarget, target);
|
await fs.rename(tmpTarget, target);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user