Skip to content

Commit

Permalink
fix(installer): potential endless loop on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sdorra committed Nov 14, 2024
1 parent 2306eed commit 8e1dd83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/olive-mails-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"content-collections": patch
"@content-collections/installer": patch
---

Fix potential endless loop on windows
4 changes: 2 additions & 2 deletions packages/installer/src/migration/tasks/gitignore.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { existsSync } from "node:fs";
import fs from "node:fs/promises";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { Task } from "./index.js";

function findGitIgnore(directory: string): string | null {
let current = directory;
while (current !== "/") {
while (current !== dirname(current)) {
const gitIgnore = join(current, ".gitignore");
if (existsSync(gitIgnore)) {
return gitIgnore;
Expand Down

0 comments on commit 8e1dd83

Please sign in to comment.