Skip to content

Commit

Permalink
Merge pull request #1187 from izaera/detect_package_lock
Browse files Browse the repository at this point in the history
feat(npm-scripts): detect root dir when package-lock.json present
  • Loading branch information
izaera authored Jan 9, 2024
2 parents ac283c8 + 49ceed5 commit 083ff29
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ function findRoot() {
let directory = process.cwd();

while (directory) {
if (fs.existsSync(path.join(directory, 'yarn.lock'))) {
if (
fs.existsSync(path.join(directory, 'yarn.lock')) ||
fs.existsSync(path.join(directory, 'package-lock.json'))
) {
const basename = path.basename(directory);

if (basename === 'modules') {
Expand Down

0 comments on commit 083ff29

Please sign in to comment.