angular/aio/tools/transforms/cli-docs-package/extract-cli-commands.js
Paul Gschwendtner 68a6a075f4 build: clean up references to old master branch (#45856)
Cleans up all references to the `master` branch we renamed to
`main` across Angular.

PR Close #45856
2022-05-04 16:23:33 -07:00

16 lines
531 B
JavaScript

const {resolve} = require('canonical-path');
const sh = require('shelljs');
const {CONTENTS_PATH} = require('../config');
const cliGitRef = process.argv[2] || 'main'; // Can be a branch, commit or tag.
const pkgContent = JSON.stringify({
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');