@equinor/fusion-framework-cli
Version:
Command-line toolkit for developing, building, and publishing Fusion Framework applications and portal templates. Provides a unified developer experience from local development to production deployment.
18 lines • 532 B
JavaScript
import { execSync } from 'node:child_process';
/**
* Resolves the current Git branch for the working tree.
*
* @returns The current branch name, or `undefined` when not in a Git repository
* or when HEAD is detached.
*/
export const resolveGitBranch = () => {
try {
const branch = execSync('git branch --show-current').toString().trim();
return branch || undefined;
}
catch {
return undefined;
}
};
export default resolveGitBranch;
//# sourceMappingURL=resolve-git-branch.js.map