Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit 5d11a20

Browse files
committed
Avoid deleted files
1 parent 32595b1 commit 5d11a20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/sane-fmt/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict'
2+
const path = require('path')
23
const fs = require('fs')
34
const process = require('process')
45
const git = require('isomorphic-git')
@@ -21,7 +22,8 @@ async function listTargets() {
2122
})
2223
).map(([filename]) => filename)
2324

24-
return new Set([...fromLS, ...fromStatus])
25+
return [...new Set([...fromLS, ...fromStatus])]
26+
.filter(filename => fs.existsSync(path.resolve(project, filename)))
2527
}
2628

2729
async function createArgv() {

0 commit comments

Comments
 (0)