Skip to content

Commit 39aa7db

Browse files
committed
fix(usecases): skip tmp dirs in config search
1 parent 17f1678 commit 39aa7db

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

packages/lib/src/usecases/docker-git-config-search.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ type DockerGitConfigSearchState = {
1111
const isDockerGitConfig = (entry: string): boolean => entry.endsWith("docker-git.json")
1212

1313
const shouldSkipDir = (entry: string): boolean =>
14-
entry === ".git" || entry === ".orch" || entry === ".docker-git" || entry === ".cache" || entry === "node_modules"
14+
entry === ".git" ||
15+
entry === ".orch" ||
16+
entry === ".docker-git" ||
17+
entry === ".cache" ||
18+
entry === "node_modules" ||
19+
entry === "tmp"
1520

1621
const isNotFoundStatError = (error: PlatformError): boolean =>
1722
error._tag === "SystemError" && error.reason === "NotFound"

packages/lib/tests/usecases/docker-git-config-search.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ describe("findDockerGitConfigPaths", () => {
4444
const ignoredOrch = path.join(root, "org/repo-a/.orch/docker-git.json")
4545
const ignoredRootCache = path.join(root, ".cache/packages/pnpm/store/v10/index/docker-git.json")
4646
const ignoredDockerGit = path.join(root, ".docker-git/.cache/git-mirrors/docker-git.json")
47+
const ignoredTmp = path.join(root, "org/tmp/repo-c/docker-git.json")
4748

4849
yield* _(writeFileWithParents(fs, path, includedMain))
4950
yield* _(writeFileWithParents(fs, path, includedNested))
5051
yield* _(writeFileWithParents(fs, path, ignoredGit))
5152
yield* _(writeFileWithParents(fs, path, ignoredOrch))
5253
yield* _(writeFileWithParents(fs, path, ignoredRootCache))
5354
yield* _(writeFileWithParents(fs, path, ignoredDockerGit))
55+
yield* _(writeFileWithParents(fs, path, ignoredTmp))
5456

5557
const found = yield* _(findDockerGitConfigPaths(fs, path, root))
5658
expect([...found].sort()).toEqual([includedMain, includedNested].sort())

0 commit comments

Comments
 (0)