Skip to content

Commit

Permalink
feat(clean): clean log files, closes #1159
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Sep 10, 2019
1 parent f06157a commit 1777523
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/util/clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export default async function(): Promise<void> {
await util.promisify(fs.unlink)(file)
}
}
dir = process.env.XDG_RUNTIME_DIR || dir
files = glob.sync(path.join(dir, '/coc-nvim-*.log'))
for (let file of files) {
if (path.basename(file) != `coc-nvim-${process.pid}.log`) {
await util.promisify(fs.unlink)(file)
}
}
} catch (e) {
// noop
}
Expand Down

0 comments on commit 1777523

Please sign in to comment.