-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathset-angular-version.js
More file actions
33 lines (27 loc) · 803 Bytes
/
Copy pathset-angular-version.js
File metadata and controls
33 lines (27 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const fs = require('fs');
const angularVersion = process.env.ANGULAR_VERSION;
if (!angularVersion) {
throw new Error('ANGULAR_VERSION must be set');
}
const path = 'ct-angular/package.json';
const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
const angularDeps = [
'@angular/animations',
'@angular/common',
'@angular/compiler',
'@angular/core',
'@angular/forms',
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/router',
];
const angularDevDeps = [
'@angular-devkit/build-angular',
'@angular/cli',
'@angular/compiler-cli',
];
for (const name of angularDeps)
pkg.dependencies[name] = angularVersion;
for (const name of angularDevDeps)
pkg.devDependencies[name] = angularVersion;
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n');