Miroslav Jonaš 9e06020575
feat(core): toggle additional prompts in CNW with a flag (#9546)
* feat(core): toggle additional prompts in CNW with a flag

* feat(repo): handle cli params with yargs

* feat(core): add docs generation

* chore(repo): add colors

* fix(core): migrate to yargs 17.x

* fix(core): update markup generation
2022-03-29 14:00:07 -04:00

18 lines
458 B
TypeScript

import { execSync } from 'child_process';
/*
* Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation)
* we duplicate the helper functions from @nrwl/workspace in this file.
*/
export function deduceDefaultBase(): string {
const nxDefaultBase = 'main';
try {
return (
execSync('git config --get init.defaultBranch').toString().trim() ||
nxDefaultBase
);
} catch {
return nxDefaultBase;
}
}