Skip to content

Commit

Permalink
fix: detect node_modules folder for project location detection
Browse files Browse the repository at this point in the history
  • Loading branch information
saitho committed Nov 29, 2020
1 parent de182c5 commit 2dc2af9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ if (path.isAbsolute(rootPath)) {
} else {
projectLocations.push(path.join(__dirname, rootPath));

if (argv.hasOwnProperty('pnpm')) {
// PNPM has a different folder structure. We have jump up a few levels to find package.json
// if loaded from node_modules folder, step back a few levels
if (__dirname.match('/.*node_modules\/@saithodev\/ts-appversion.*/')) {
projectLocations.unshift(
path.join(__dirname, '..', '..', '..', '..', '..', '..', rootPath)
path.join(__dirname, '..', '..', '..', '..', rootPath)
);
}
}
Expand Down

0 comments on commit 2dc2af9

Please sign in to comment.