UNPKG

zhangdocs

Version:

Simple document generation tool. Dependence Node.js run.

22 lines (16 loc) 440 B
var shell = require('shelljs'); var name = shell.exec('git config --get user.name', { silent: true }).stdout.trim(); var email = shell.exec('git config --get user.email', { silent: true }).stdout.trim(); var result = name ? name : process.env.USER; if (!shell.which('git')) { result = 'Pick a name'; email = 'Your email'; } if (email) { result += ' <' + email + '>'; } module.exports = result;