Skip to content

fix: avoid double npm run commands if build-script is given as input - #133

Closed
ali-garajian wants to merge 2 commits into
preactjs:masterfrom
ali-garajian:master
Closed

fix: avoid double npm run commands if build-script is given as input#133
ali-garajian wants to merge 2 commits into
preactjs:masterfrom
ali-garajian:master

Conversation

@ali-garajian

Copy link
Copy Markdown

this screenshot is from preact repo's ci.

notice ... npm run npm run --if-present noop

Screenshot 1404-12-04 at 00 43 01

Comment thread src/index.js
Comment on lines -63 to +65
console.log(`Building using ${packageManager} run ${buildScript}`);
await exec(`${packageManager} run ${buildScript}`);
console.log(`Building using ${buildScript}`);
await exec(buildScript);

@rschristian rschristian Feb 22, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exec calls cannot be touched, this would be a breaking change.

#126 already made this change for v3, but for v2, we're left treating build-script as a script name, e.g., build, build:core, etc. Not a full command.

You can try to handle the console logs on their own if you want to though.

Needs to be updated here too:

startGroup(`[base] Build using ${packageManager}`);
await exec(`${packageManager} run ${buildScript}`);

Edit: Or apparently not, as we're missing a console.log there. Oops

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh you're right! I didn't count for build-script being a script name :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants