MCPcopy Create free account
hub / github.com/fontsource/fontsource / getGitConfig

Function getGitConfig

packages/publish/src/git.ts:11–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10// Get Git config
11export const getGitConfig = async (): Promise<Git> => {
12 const configPath = path.join(os.homedir(), '.gitconfig');
13 try {
14 await fs.stat(configPath);
15 const gitconfig = await parse({ cwd: '/', path: configPath });
16 const author: Git = {
17 name: gitconfig?.user.name,
18 email: gitconfig?.user.email,
19 };
20 return author;
21 } catch {
22 throw new Error('Error reading Git config.');
23 }
24};
25
26export const gitAdd = async (): Promise<void> => {
27 await execa('git', ['add', '--all']);

Callers 1

publishPackagesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected