Skip to content

Commit

Permalink
fix: create symlink file
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Dec 29, 2023
1 parent eba2e0c commit 51c72ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ export function createCurrentSymLink(logfile, name) {
const current = logPath + '/' + symLinkName;
try {
const stats = fs.lstatSync(current);
if (stats.isSymbolicLink()) {
const targetPath = fs.readlinkSync(current);
if (stats.isSymbolicLink() && targetPath !== logfileName) {
fs.unlinkSync(current);
fs.symlinkSync(logfileName, current);
}
Expand Down

0 comments on commit 51c72ed

Please sign in to comment.