* 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
18 lines
458 B
TypeScript
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;
|
|
}
|
|
}
|