diff options
Diffstat (limited to 'src/git-command-manager.ts')
| -rw-r--r-- | src/git-command-manager.ts | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 409a161..699a963 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -21,7 +21,8 @@ export interface IGitCommandManager { config( configKey: string, configValue: string, - globalConfig?: boolean + globalConfig?: boolean, + add?: boolean ): Promise<void> configExists(configKey: string, globalConfig?: boolean): Promise<boolean> fetch(refSpec: string[], fetchDepth?: number): Promise<void> @@ -140,14 +141,15 @@ class GitCommandManager { async config( configKey: string, configValue: string, - globalConfig?: boolean + globalConfig?: boolean, + add?: boolean ): Promise<void> { - await this.execGit([ - 'config', - globalConfig ? '--global' : '--local', - configKey, - configValue - ]) + const args: string[] = ['config', globalConfig ? '--global' : '--local'] + if (add) { + args.push('--add') + } + args.push(...[configKey, configValue]) + await this.execGit(args) } async configExists( |
