( options: T, parser: IGitProgressParser, progressCallback: (progress: IGitProgress | IGitOutput) => void )
| 17 | * be overwritten. |
| 18 | */ |
| 19 | export async function executionOptionsWithProgress< |
| 20 | T extends IGitExecutionOptions |
| 21 | >( |
| 22 | options: T, |
| 23 | parser: IGitProgressParser, |
| 24 | progressCallback: (progress: IGitProgress | IGitOutput) => void |
| 25 | ): Promise<T> { |
| 26 | let lfsProgressPath = null |
| 27 | let env = {} |
| 28 | if (options.trackLFSProgress) { |
| 29 | try { |
| 30 | lfsProgressPath = await createLFSProgressFile() |
| 31 | env = { GIT_LFS_PROGRESS: lfsProgressPath } |
| 32 | } catch (e) { |
| 33 | log.error('Error writing LFS progress file', e) |
| 34 | env = { GIT_LFS_PROGRESS: null } |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | return merge(options, { |
| 39 | processCallback: createProgressProcessCallback( |
| 40 | parser, |
| 41 | lfsProgressPath, |
| 42 | progressCallback |
| 43 | ), |
| 44 | env: merge(options.env, env), |
| 45 | }) |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Returns a callback which can be passed along to the processCallback option |
no test coverage detected