UNPKG

gitsha

Version:

read git SHA1 value of a repository's HEAD revision

17 lines (15 loc) 403 B
// Generated by CoffeeScript 1.6.3 (function() { module.exports = function(path, callback) { var exec; exec = require('child_process').exec; return exec('git rev-parse --short HEAD', { cwd: path }, function(error, stdout, stderr) { if (error) { return callback(error, stderr.trim()); } return callback(null, stdout.trim()); }); }; }).call(this);