(name: string)
| 44 | let counter = 1; |
| 45 | |
| 46 | const checkFile = async (name: string) => { |
| 47 | const absolutePath = fileManager.toAbsolutePath(path.normalize(path.join(dir, name))); |
| 48 | const isLock = await lockfile |
| 49 | .check(absolutePath) |
| 50 | .then((isLock) => isLock) |
| 51 | .catch(() => false); |
| 52 | const isAccess = await fs |
| 53 | .access(absolutePath) |
| 54 | .then(() => true) |
| 55 | .catch(() => false); |
| 56 | return isAccess && !isLock && !overwrite; |
| 57 | }; |
| 58 | |
| 59 | while (await checkFile(tempFileSaveName)) { |
| 60 | if (counter == 1) { |
nothing calls this directly
no test coverage detected