Skip to content

Commit

Permalink
Merge pull request #135 from NickKaramoff/134-ignore-publish
Browse files Browse the repository at this point in the history
Remove 'publish' script if it's 'clean-publish'
  • Loading branch information
ai committed Dec 4, 2021
2 parents 8af55f7 + ec8f192 commit c4fe845
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core.js
Expand Up @@ -46,6 +46,15 @@ export function clearPackageJSON(
cleanPackageJSON.scripts = filterObjectByKey(packageJson.scripts, script =>
NPM_SCRIPTS.includes(script)
)

if (
cleanPackageJSON.scripts.publish &&
(cleanPackageJSON.scripts.publish === 'clean-publish' ||
cleanPackageJSON.scripts.publish.startsWith('clean-publish '))
) {
// "custom" publish script is actually calling clean-publish
delete cleanPackageJSON.scripts.publish
}
}

if (isObject(packageJson.exports) && !ignoreFields.includes('exports')) {
Expand Down

0 comments on commit c4fe845

Please sign in to comment.