How to use the branch function from yargs

Find comprehensive JavaScript yargs.branch code examples handpicked from public code repositorys.

74
75
76
77
78
79
80
81
82
83
        commit = `commit-${NOT_AVAILABLE}`;
    }
}

if (argv.branch) {
    branch = argv.branch;
} else {
    try {
        branch = child_process.execSync('git rev-parse --abbrev-ref HEAD').toString().replace(/^\s+|\s+$/g, '');
    } catch(err) {
fork icon9
star icon86
watch icon7

43
44
45
46
47
48
49
50
51
52
});

gulp.task('versionAndPublish', ['bump', 'npmPublish']);

gulp.task('tag', ['bump', 'npmPublish'], function(){
  var branch = argv.branch;
  var pkg = require('./package.json');
  var v = 'v' + pkg.version;
  var message = 'Release ' + v;
  if (!branch) {
fork icon2
star icon0
watch icon5

+ 3 other calls in file

22
23
24
25
26
27
28
29
30
31
32
async function main() {
  if (!args.repoPath || !args.branch) {
    printUsage();
    return;
  } else {
    BRANCH = args.branch;
    ANYTHINK_REPO_PATH = args.repoPath;
  }


  if (!process.env.API_SERVER_TOKEN) {
fork icon0
star icon1
watch icon0

Other functions in yargs

Sorted by popularity

function icon

yargs.argv is the most popular function in yargs (1012 examples)