yeoman-generator
Version:
Rails-inspired generator system that provides scaffolding for your apps
34 lines (33 loc) • 983 B
JavaScript
class GitUtil {
constructor(parent) {
this.
}
/**
* Retrieves user's name from Git in the global scope or the project scope
* (it'll take what Git will use in the current context)
* @return {Promise<string>} configured git name or undefined
*/
async name() {
const { value } = await this.
return value ?? undefined;
}
/**
* Retrieves user's email from Git in the global scope or the project scope
* (it'll take what Git will use in the current context)
* @return {Promise<string>} configured git email or undefined
*/
async email() {
const { value } = await this.
return value ?? undefined;
}
}
export class GitMixin {
_git;
get git() {
if (!this._git) {
this._git = new GitUtil(this);
}
return this._git;
}
}