INNER CODE UNIT · TypeScript
getUserInfo
bitjson/typescript-starter · src/cli/tasks.ts:88
export const getUserInfo = (spawner: typeof execa) => async () => {
const opts: Options = {
encoding: 'utf8',
stdio: ['pipe', 'pipe', 'inherit'],
};
try {
const nameResult = await spawner('git', ['config', 'user.name'], opts);
const emailResult = await spawner('git', ['config', 'user.email'], opts);
return {
gitEmail: emailResult.stdout,
gitName: nameResult.stdout,
};
} catch (err) {
return {
gitEmail: Placeholders.email,
gitName: Placeholders.name,
};
}