UNPKG

git-command-helper

Version:
24 lines (20 loc) 609 B
// git-command-helper 2.1.0 by Dimas Lanjaka <dimaslanjaka@gmail.com> (https://www.webmanajemen.com) 'use strict'; var _ = require('lodash'); require('bluebird'); require('cross-spawn'); var spawnAsync = require('../dependencies/@expo/spawn-async/build/spawnAsync.js'); require('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); } } exports.getGithubCurrentBranch = getGithubCurrentBranch;