diff options
| author | eric sciple <ericsciple@users.noreply.github.com> | 2020-03-18 23:33:26 -0400 |
|---|---|---|
| committer | eric sciple <ericsciple@users.noreply.github.com> | 2020-03-18 23:33:26 -0400 |
| commit | d35c5b0d45c2389911e8fa57f5a409dc7eb4eba9 (patch) | |
| tree | 9504842130011e5303867f926b8e6016a715323e /src/git-command-manager.ts | |
| parent | 6f1b729011b34bc28608462b6293df85180aba9c (diff) | |
use token for workflow repo
Diffstat (limited to 'src/git-command-manager.ts')
| -rw-r--r-- | src/git-command-manager.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 4cbfe4a..a874e35 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -33,6 +33,7 @@ export interface IGitCommandManager { remoteAdd(remoteName: string, remoteUrl: string): Promise<void> removeEnvironmentVariable(name: string): void setEnvironmentVariable(name: string, value: string): void + setRemoteUrl(url: string): Promise<void> submoduleForeach(command: string, recursive: boolean): Promise<string> submoduleSync(recursive: boolean): Promise<void> submoduleUpdate(fetchDepth: number, recursive: boolean): Promise<void> @@ -40,7 +41,7 @@ export interface IGitCommandManager { tryClean(): Promise<boolean> tryConfigUnset(configKey: string, globalConfig?: boolean): Promise<boolean> tryDisableAutomaticGarbageCollection(): Promise<boolean> - tryGetFetchUrl(): Promise<string> + tryGetRemoteUrl(): Promise<string> tryReset(): Promise<boolean> } @@ -241,6 +242,10 @@ class GitCommandManager { this.gitEnv[name] = value } + async setRemoteUrl(value: string): Promise<void> { + await this.config('git.remote.url', value) + } + async submoduleForeach(command: string, recursive: boolean): Promise<string> { const args = ['submodule', 'foreach'] if (recursive) { @@ -309,7 +314,7 @@ class GitCommandManager { return output.exitCode === 0 } - async tryGetFetchUrl(): Promise<string> { + async tryGetRemoteUrl(): Promise<string> { const output = await this.execGit( ['config', '--local', '--get', 'remote.origin.url'], true |
