19 lines
342 B
TypeScript
19 lines
342 B
TypeScript
import consola from 'consola';
|
|
import { exec, getPkgJSON } from './utils';
|
|
|
|
const { version } = getPkgJSON();
|
|
|
|
main();
|
|
|
|
function main() {
|
|
let command = 'npm publish --access public';
|
|
|
|
const preid = version.match(/\d-(.+)\.\d$/)?.[1];
|
|
if (preid) {
|
|
command += ` --tag ${preid}`;
|
|
}
|
|
|
|
consola.info('Publish NPM');
|
|
exec(command);
|
|
}
|