git-command-helper
Version:
github command helper for nodejs
24 lines (20 loc) • 609 B
JavaScript
// git-command-helper 2.1.0 by Dimas Lanjaka <dimaslanjaka@gmail.com> (https://www.webmanajemen.com)
;
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;