Skip to content

Commit

Permalink
Add Docker host info to task env (#2651)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored Jan 20, 2021
1 parent 1542c8f commit 9ceb7bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tasks/DockerPseudoterminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { CancellationToken, CancellationTokenSource, Event, EventEmitter, Pseudoterminal, TaskScope, TerminalDimensions, workspace, WorkspaceFolder } from 'vscode';
import { addDockerSettingsToEnv } from '../utils/addDockerSettingsToEnv';
import { CommandLineBuilder } from '../utils/commandLineBuilder';
import { resolveVariables } from '../utils/resolveVariables';
import { spawnAsync } from '../utils/spawnAsync';
Expand Down Expand Up @@ -63,10 +64,11 @@ export class DockerPseudoterminal implements Pseudoterminal {
// Output what we're doing, same style as VSCode does for ShellExecution/ProcessExecution
this.write(`> ${commandLine} <\r\n\r\n`, DEFAULTBOLD);

// TODO: Maybe support remote Docker hosts and do addDockerSettingsToEnvironment?
const newEnv = { ...process.env };
addDockerSettingsToEnv(newEnv, process.env);
await spawnAsync(
commandLine,
{ cwd: folder.uri.fsPath },
{ cwd: folder.uri.fsPath, env: newEnv },
(stdout: string) => {
this.writeOutput(stdout);
},
Expand Down

0 comments on commit 9ceb7bb

Please sign in to comment.