Skip to content

Commit 70553a8

Browse files
clydinKeen Yee Liau
authored andcommitted
test: use registry option for E2E local package repository publish
1 parent 2468814 commit 70553a8

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed
Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
1-
import * as fs from 'fs';
21
import { prerelease } from 'semver';
32
import { packages } from '../../../../lib/packages';
43
import { npm } from '../utils/process';
54

65
export default async function() {
7-
const pre = prerelease(packages['@angular/cli'].version);
8-
9-
fs.writeFileSync('.npmrc', 'registry = http://localhost:4873', 'utf8');
6+
const publishArgs = [
7+
'run',
8+
'admin',
9+
'--',
10+
'publish',
11+
'--versionCheck=false',
12+
'--branchCheck=false',
13+
'--registry=http://localhost:4873',
14+
];
1015

11-
try {
12-
const publishArgs = [
13-
'run',
14-
'admin',
15-
'--',
16-
'publish',
17-
'--versionCheck',
18-
'false',
19-
'--branchCheck',
20-
'false',
21-
];
22-
if (pre && pre.length > 0) {
23-
publishArgs.push('--tag');
24-
publishArgs.push('next');
25-
}
26-
await npm(...publishArgs);
27-
} finally {
28-
fs.unlinkSync('.npmrc');
16+
const pre = prerelease(packages['@angular/cli'].version);
17+
if (pre && pre.length > 0) {
18+
publishArgs.push('--tag', 'next');
2919
}
20+
21+
await npm(...publishArgs);
3022
}

0 commit comments

Comments
 (0)