build(docs-infra): make the git ref for cli command docs configurable (#26391)
PR Close #26391
This commit is contained in:
parent
7acdad6921
commit
67608a907e
|
@ -1 +1,3 @@
|
||||||
yarn.lock
|
/node_modules
|
||||||
|
package.json
|
||||||
|
yarn.lock
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"dependencies": {
|
|
||||||
"@angular/cli": "https://github.com/angular/cli-builds#master"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,16 @@
|
||||||
const shelljs = require('shelljs');
|
const {resolve} = require('canonical-path');
|
||||||
const {resolve} = require('canonical-path');
|
const sh = require('shelljs');
|
||||||
const {CONTENTS_PATH} = require('../config');
|
const {CONTENTS_PATH} = require('../config');
|
||||||
|
|
||||||
shelljs.cd(resolve(CONTENTS_PATH, 'cli-src'));
|
const cliGitRef = process.argv[2] || 'master'; // Can be a branch, commit or tag.
|
||||||
shelljs.exec('git clean -Xfd');
|
const pkgContent = JSON.stringify({
|
||||||
shelljs.exec('yarn install');
|
dependencies: {
|
||||||
|
'@angular/cli': `https://github.com/angular/cli-builds#${cliGitRef}`,
|
||||||
|
},
|
||||||
|
}, null, 2);
|
||||||
|
|
||||||
|
sh.set('-e');
|
||||||
|
sh.cd(resolve(CONTENTS_PATH, 'cli-src'));
|
||||||
|
sh.exec('git clean -Xfd');
|
||||||
|
sh.echo(pkgContent).to('package.json');
|
||||||
|
sh.exec('yarn install --no-lockfile --non-interactive');
|
||||||
|
|
Loading…
Reference in New Issue