create-nx-workspace
Version:
20 lines (19 loc) • 643 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.deduceDefaultBase = deduceDefaultBase;
const child_process_1 = require("child_process");
/*
* Because we don't want to depend on @nx/workspace (to speed up the workspace creation)
* we duplicate the helper functions from @nx/workspace in this file.
*/
function deduceDefaultBase() {
const nxDefaultBase = 'main';
try {
return ((0, child_process_1.execSync)('git config --get init.defaultBranch', { windowsHide: false })
.toString()
.trim() || nxDefaultBase);
}
catch {
return nxDefaultBase;
}
}