mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-01 18:15:13 +00:00
Update npm publish script with OTP support
This commit is contained in:
@@ -61,6 +61,7 @@
|
|||||||
"inline-style-prefixer": "^6.0.0",
|
"inline-style-prefixer": "^6.0.0",
|
||||||
"jest": "^27.5.1",
|
"jest": "^27.5.1",
|
||||||
"lint-staged": "^10.5.4",
|
"lint-staged": "^10.5.4",
|
||||||
|
"minimist": "^1.2.6",
|
||||||
"npm-run-all": "^4.1.3",
|
"npm-run-all": "^4.1.3",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.2.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
|
|||||||
@@ -5,11 +5,15 @@
|
|||||||
const execSync = require('child_process').execSync;
|
const execSync = require('child_process').execSync;
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
|
const minimist = require('minimist');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
const version = args[0];
|
const argv = minimist(args);
|
||||||
const skipGit = args[1] === '--skip-git';
|
|
||||||
|
const version = argv._[0];
|
||||||
|
const skipGit = argv['skip-git'];
|
||||||
|
const oneTimeCode = argv.otp;
|
||||||
|
|
||||||
console.log(`Publishing ${version}`);
|
console.log(`Publishing ${version}`);
|
||||||
|
|
||||||
@@ -53,7 +57,7 @@ if (!skipGit) {
|
|||||||
// Publish public packages
|
// Publish public packages
|
||||||
workspaces.forEach(({ directory, packageJson }) => {
|
workspaces.forEach(({ directory, packageJson }) => {
|
||||||
if (!packageJson.private) {
|
if (!packageJson.private) {
|
||||||
execSync(`cd ${directory} && npm publish`);
|
execSync(`cd ${directory} && npm publish --otp ${oneTimeCode}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user