Skip to content

Commit

Permalink
feat(npm-scripts): detect root dir when package-lock.json present
Browse files Browse the repository at this point in the history
This is needed so that liferay-portal's Playwright tests can use
npm-scripts without the `--experimental-standalone` flag.
  • Loading branch information
izaera committed Jan 9, 2024
1 parent ac283c8 commit 49ceed5
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 49ceed5

Please sign in to comment.