From ede463048e86672a962cd6ff413fdba2712618d8 Mon Sep 17 00:00:00 2001 From: Benedek Kozma Date: Thu, 30 Jan 2025 12:49:55 +0100 Subject: [PATCH] prepend current directory to package resolved path --- src/installer.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index 62352884..b8100169 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -44,8 +44,12 @@ export class SwiftToolInstaller { } parsePackageResolved(): string { - if (fs.existsSync(this.packageResolvedPath)) { - const fileContents = fs.readFileSync(this.packageResolvedPath, { encoding: 'utf8' }) + let packageResolvedPath = this.packageResolvedPath + if (!packageResolvedPath.startsWith('./')) { + packageResolvedPath = `./${packageResolvedPath}` + } + if (fs.existsSync(packageResolvedPath)) { + const fileContents = fs.readFileSync(packageResolvedPath, { encoding: 'utf8' }) const parsedContents = new PackageResolved(fileContents) for (const entry of parsedContents.pins) { if (entry.location == this.url) {