mirror of
https://github.com/crazy-max/ghaction-import-gpg.git
synced 2024-12-25 12:42:07 -05:00
18 lines
498 B
TypeScript
18 lines
498 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 getConfig(key: string): Promise<string> {
|
|
return await git(['config', key]);
|
|
}
|
|
|
|
export async function setConfig(key: string, value: string): Promise<void> {
|
|
await git(['config', key, value]);
|
|
}
|