Skip to content

Commit

Permalink
prepend current directory to package resolved path
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberbeni committed Jan 30, 2025
1 parent b902c18 commit ede4630
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ede4630

Please sign in to comment.