Update npm publish script with OTP support

This commit is contained in:
Nicolas Gallagher
2022-06-14 10:46:31 -07:00
parent 0a0bb5d879
commit fa10c75daf
3 changed files with 5808 additions and 6406 deletions

View File

@@ -61,6 +61,7 @@
"inline-style-prefixer": "^6.0.0",
"jest": "^27.5.1",
"lint-staged": "^10.5.4",
"minimist": "^1.2.6",
"npm-run-all": "^4.1.3",
"prettier": "^2.2.1",
"react": "^17.0.2",

View File

@@ -5,11 +5,15 @@
const execSync = require('child_process').execSync;
const fs = require('fs');
const glob = require('glob');
const minimist = require('minimist');
const path = require('path');
const args = process.argv.slice(2);
const version = args[0];
const skipGit = args[1] === '--skip-git';
const argv = minimist(args);
const version = argv._[0];
const skipGit = argv['skip-git'];
const oneTimeCode = argv.otp;
console.log(`Publishing ${version}`);
@@ -53,7 +57,7 @@ if (!skipGit) {
// Publish public packages
workspaces.forEach(({ directory, packageJson }) => {
if (!packageJson.private) {
execSync(`cd ${directory} && npm publish`);
execSync(`cd ${directory} && npm publish --otp ${oneTimeCode}`);
}
});

12203
yarn.lock

File diff suppressed because it is too large Load Diff