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
+1
View File
@@ -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",
+7 -3
View File
@@ -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}`);
} }
}); });
+5800 -6403
View File
File diff suppressed because it is too large Load Diff