Skip to content

Commit

Permalink
build: remove scripts from published package
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Feb 15, 2024
1 parent 81eb0d0 commit d54a5fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/node_modules/@stdlib/_tools/scripts/publish_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ function publish( pkg, clbk ) {
escaped = replace( dep, '@', '\\@' );
escaped = replace( escaped, '/', '\\/' );
command = [
'if ! find lib test -name "*.js" -exec grep -q "'+escaped+'" {} + && ! grep -q -s "'+escaped+'" manifest.json && ! grep -q -s "'+escaped+'" include.gypi; then',
'if ! find lib -name "*.js" -exec grep -q "'+escaped+'" {} + && ! grep -q -s "'+escaped+'" manifest.json && ! grep -q -s "'+escaped+'" include.gypi; then',
' printf "false"',
'else',
' printf "true"',
Expand All @@ -1256,7 +1256,7 @@ function publish( pkg, clbk ) {
escaped = replace( dep, '@', '\\@' );
escaped = replace( escaped, '/', '\\/' );
command = [
'if ! find lib test -name "*.js" -exec grep -q "'+escaped+'" {} + && ! grep -q -s "'+escaped+'" manifest.json && ! grep -q -s "'+escaped+'" include.gypi; then',
'if ! find lib -name "*.js" -exec grep -q "'+escaped+'" {} + && ! grep -q -s "'+escaped+'" manifest.json && ! grep -q -s "'+escaped+'" include.gypi; then',
' printf "false"',
'else',
' printf "true"',
Expand All @@ -1283,6 +1283,8 @@ function publish( pkg, clbk ) {
command = 'find . -type f -name \'*.md\' -print0 | xargs -0 perl -0777 -i -pe "s/\\`\\`\\`\n\nAlternatively,[^<]+<\\/section>/\\`\\`\\`\n\n<\\/section>/"';
shell( command, opts );

// Set `scripts` field to an empty object:
pkgJSON.scripts = {};
writeFileSync( pkgJsonPath, JSON.stringify( pkgJSON, null, ' ' ).concat( '\n' ) );

shell( 'npm publish --access public', opts );
Expand Down

0 comments on commit d54a5fd

Please sign in to comment.