Skip to content

Commit 2468814

Browse files
clydinKeen Yee Liau
authored andcommitted
build: support publish registry option
1 parent 1b5cf71 commit 2468814

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/publish.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface PublishArgs {
1717
tag?: string;
1818
branchCheck?: boolean;
1919
versionCheck?: boolean;
20+
registry?: string;
2021
}
2122

2223

@@ -106,7 +107,15 @@ export default async function (args: PublishArgs, logger: logging.Logger) {
106107
.then(() => {
107108
logger.info(name);
108109

109-
return _exec('npm', ['publish'].concat(args.tag ? ['--tag', args.tag] : []), {
110+
const publishArgs = ['publish'];
111+
if (args.tag) {
112+
publishArgs.push('--tag', args.tag);
113+
}
114+
if (args.registry) {
115+
publishArgs.push('--registry', args.registry);
116+
}
117+
118+
return _exec('npm', publishArgs, {
110119
cwd: pkg.dist,
111120
}, logger);
112121
})

0 commit comments

Comments
 (0)