How to use git-rev - 4 common examples

To help you get started, we’ve selected a few git-rev examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github epsil / spotgen / index.js View on Github external
function main () {
  var input = process.argv[2]
  var output = process.argv[3]
  var str = input
  if (typeof input === 'string' &&
      input.match(/(^-*h(elp)?$)|(^\/\?$)/gi)) {
    console.log(help)
    return
  } else if (typeof input === 'string' &&
             input.match(/(^-*v(ersion)?$)|(^\/\?$)/gi)) {
    process.chdir(__dirname)
    git.short(function (sha) {
      console.log(pkg.version + (sha ? ('+' + sha) : ''))
    })
    return
  }
  if (!input) {
    console.log('Enter generator string (submit with Ctrl-D):')
    var ps = prompt()
    ps.multiline(function (err, lines, str) {
      ps.close()
      if (err) {
        return
      }
      if (str !== '' && str.slice(-1) !== '\n') {
        console.log('')
      }
      generate(str)
github OstlerDev / PopcornTV / atv.js View on Github external
function startServers(data) {
    try {
        git.short(function (str) {
          logger.notice('Starting Commit', str)
        })
    } catch(e) {
        logger.error(e.stack || e);
    }

    try {
        config = JSON.parse(data);
        const LOCAL_IP = config.ip;
        logger.notice("Starting PopcornTV");
        dns.startDnsProxy(LOCAL_IP);
        webservers.startWebServer(LOCAL_IP);
        webservers.startSSLWebServer(LOCAL_IP);
    } catch (err) {
        logger.error('There is an error starting Popcorn TV, please post this on the Github page')
        logger.error(err.stack || err);
github dozoisch / koa-react-full-example / gulpfile.js View on Github external
gulp.task("write-build-info", function (cb) {
  var buildInfos = {
    version : packagejson.version
  };
  require("git-rev").short(function (str) {
    buildInfos.commit = str;
    fs.writeFile(paths.out.build_info, JSON.stringify(buildInfos, null, 2), cb);
  });
});
github kube-js / kube-ts-server / src / presenter / express / api / commons / checks / checkVersion / index.ts View on Github external
new Promise(resolve => {
        git.short(resolve);
      }),
      new Promise(resolve => {

git-rev

get the current git commit hash, tag or branch in node

MIT
Latest version published 11 years ago

Package Health Score

50 / 100
Full package analysis

Popular git-rev functions