Skip to content

Commit

Permalink
fixed cwd for publish-npm script
Browse files Browse the repository at this point in the history
  • Loading branch information
Luna Wei committed Mar 20, 2023
1 parent c05d191 commit f40f8f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/publish-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ const yargs = require('yargs');
const buildTag = process.env.CIRCLE_TAG;
const otp = process.env.NPM_CONFIG_OTP;

const RN_PACKAGE_DIR = path.join(__dirname, '..', 'packages', 'react-native');

const argv = yargs
.option('n', {
alias: 'nightly',
Expand Down Expand Up @@ -167,7 +169,7 @@ const tagFlag = nightlyBuild
// use otp from envvars if available
const otpFlag = otp ? `--otp ${otp}` : '';

if (exec(`npm publish ${tagFlag} ${otpFlag}`).code) {
if (exec(`npm publish ${tagFlag} ${otpFlag}`, {cwd: RN_PACKAGE_DIR}).code) {
echo('Failed to publish package to npm');
exit(1);
} else {
Expand Down

0 comments on commit f40f8f9

Please sign in to comment.