UNPKG

git-command-helper

Version:
22 lines (19 loc) 561 B
// git-command-helper 2.1.0 by Dimas Lanjaka <dimaslanjaka@gmail.com> (https://www.webmanajemen.com) import _ from 'lodash'; import 'bluebird'; import 'cross-spawn'; import spawnAsync from '../dependencies/@expo/spawn-async/build/spawnAsync.mjs'; import 'stream'; /** * get current branch * @returns */ async function getGithubCurrentBranch(opt = {}) { try { const result = await spawnAsync("git", ["branch", "--show-current"], opt); return result.stdout.trim(); } catch (err) { return _.noop(err); } } export { getGithubCurrentBranch };