Skip to content

Commit

Permalink
build: refactor to avoid having to copy env
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Aug 11, 2023
1 parent ce11027 commit 77b1469
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/node_modules/@stdlib/_tools/scripts/publish_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1098,16 +1098,11 @@ function publish( pkg, clbk ) {
'cwd': dist
};

// Transform error messages via jscodeshift:
// Transform error messages:
jscodeshift = join( rootDir(), 'node_modules', '.bin', 'jscodeshift' );
command = jscodeshift+' ./lib/**/*.js ./lib/*.js -t '+join( __dirname, 'transform_error_messages.js' );
command = 'STDLIB_PKG=\'@stdlib/'+dist+'\' '+jscodeshift+' ./lib/**/*.js ./lib/*.js -t '+join( __dirname, 'transform_error_messages.js' );
debug( 'Executing command: %s', command );
shell( command, {
'cwd': opts.cwd,
'env': {
'STDLIB_PKG': '@stdlib/'+dist
}
});
shell( command, opts );

// Format rewritten error messages:
command = 'find . -name "*.js" -exec sed -E -i "s/Error\\( format\\( \\"([a-zA-Z0-9]+)\\"/Error\\( format\\( \'\\1\'/g" {} \\;';
Expand Down

0 comments on commit 77b1469

Please sign in to comment.