From c654bda7a3b336f4d9a9d9e97e72cd14b27789a7 Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Sun, 8 Oct 2023 10:02:08 +0300 Subject: [PATCH] Bug fix --- lib/detectors/packagejsondetector.mts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/detectors/packagejsondetector.mts b/lib/detectors/packagejsondetector.mts index 18d0eb9..780ebfc 100644 --- a/lib/detectors/packagejsondetector.mts +++ b/lib/detectors/packagejsondetector.mts @@ -1,5 +1,5 @@ import { readFile, stat } from 'node:fs/promises'; -import { basename, join, resolve } from 'node:path'; +import { dirname, join, resolve } from 'node:path'; import { type DetectorSync, type IResource, @@ -45,7 +45,7 @@ export class PackageJsonDetector implements DetectorSync { const locations: string[] = []; // istanbul ignore next if (process.argv[1]) { - const dir = basename(process.argv[1]); + const dir = dirname(process.argv[1]); locations.push(join(dir, 'package.json'), join(dir, '..', 'package.json')); }