gpg/src/git.ts
2020-05-11 19:14:47 +02:00

14 lines
394 B
TypeScript

import * as exec from './exec';
const git = async (args: string[] = []): Promise<string> => {
return await exec.exec(`git`, args, true).then(res => {
if (res.stderr != '' && !res.success) {
throw new Error(res.stderr);
}
return res.stdout.trim();
});
};
export async function setConfig(key: string, value: string): Promise<void> {
await git(['config', key, value]);
}