diff options
| author | eric sciple <ericsciple@users.noreply.github.com> | 2021-11-01 11:43:18 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-01 11:43:18 -0500 |
| commit | 0fc042ca35b9ee6d4c6dc650662d40f189018a49 (patch) | |
| tree | b357edb1a8f6da9760e4dc15a179d0db27d9bcaa /src/git-command-manager.ts | |
| parent | d7a4963ed25cda3df63783c22befd89dcbc4508d (diff) | |
set insteadOf url for org-id (#621)v2.4.0
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( |
