Skip to content

Commit 4df89bc

Browse files
authored
Spawn yarn .cjs files also using process.execPath (#8144)
1 parent fc8489a commit 4df89bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cli/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ async function start(): Promise<void> {
635635
});
636636

637637
try {
638-
if (yarnPath.endsWith(`.js`)) {
638+
if (/\.[cm]?js$/.test(yarnPath)) {
639639
exitCode = await spawnp(process.execPath, [yarnPath, ...argv], opts);
640640
} else {
641641
exitCode = await spawnp(yarnPath, argv, opts);

0 commit comments

Comments
 (0)