Skip to content

Commit

Permalink
fix: findup until root from user cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 3, 2024
1 parent 7c1919c commit 0309498
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function findup<T>(
const segments = normalize(cwd).split("/");

while (segments.length > 0) {
const path = segments.join("/");
const path = segments.join("/") || "/";
const result = await match(path);

if (result || !options.includeParentDirs) {
Expand Down
2 changes: 1 addition & 1 deletion src/package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export async function detectPackageManager(
options: DetectPackageManagerOptions = {},
): Promise<PackageManager | undefined> {
const detected = await findup(
cwd,
resolve(cwd || "."),
async (path) => {
// 1. Use `packageManager` field from package.json
if (!options.ignorePackageJSON) {
Expand Down

0 comments on commit 0309498

Please sign in to comment.