Skip to content

Commit eba2ea7

Browse files
clydinKeen Yee Liau
authored andcommitted
build: support publish registry option
1 parent 8ef7ba5 commit eba2ea7

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

@@ -111,7 +112,15 @@ export default async function (args: PublishArgs, logger: logging.Logger) {
111112
.then(() => {
112113
logger.info(name);
113114

114-
return _exec('npm', ['publish'].concat(args.tag ? ['--tag', args.tag] : []), {
115+
const publishArgs = ['publish'];
116+
if (args.tag) {
117+
publishArgs.push('--tag', args.tag);
118+
}
119+
if (args.registry) {
120+
publishArgs.push('--registry', args.registry);
121+
}
122+
123+
return _exec('npm', publishArgs, {
115124
cwd: pkg.dist,
116125
}, logger);
117126
})

0 commit comments

Comments
 (0)