From d35c5b0d45c2389911e8fa57f5a409dc7eb4eba9 Mon Sep 17 00:00:00 2001 From: eric sciple Date: Wed, 18 Mar 2020 23:33:26 -0400 Subject: use token for workflow repo --- src/git-command-manager.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/git-command-manager.ts') 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 removeEnvironmentVariable(name: string): void setEnvironmentVariable(name: string, value: string): void + setRemoteUrl(url: string): Promise submoduleForeach(command: string, recursive: boolean): Promise submoduleSync(recursive: boolean): Promise submoduleUpdate(fetchDepth: number, recursive: boolean): Promise @@ -40,7 +41,7 @@ export interface IGitCommandManager { tryClean(): Promise tryConfigUnset(configKey: string, globalConfig?: boolean): Promise tryDisableAutomaticGarbageCollection(): Promise - tryGetFetchUrl(): Promise + tryGetRemoteUrl(): Promise tryReset(): Promise } @@ -241,6 +242,10 @@ class GitCommandManager { this.gitEnv[name] = value } + async setRemoteUrl(value: string): Promise { + await this.config('git.remote.url', value) + } + async submoduleForeach(command: string, recursive: boolean): Promise { const args = ['submodule', 'foreach'] if (recursive) { @@ -309,7 +314,7 @@ class GitCommandManager { return output.exitCode === 0 } - async tryGetFetchUrl(): Promise { + async tryGetRemoteUrl(): Promise { const output = await this.execGit( ['config', '--local', '--get', 'remote.origin.url'], true -- cgit v1.2.3