Skip to content

Commit

Permalink
add env variables to task
Browse files Browse the repository at this point in the history
  • Loading branch information
elahehrashedi authored Feb 2, 2022
1 parent bba0e98 commit d31f5b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/cmakeTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as vscode from 'vscode';
import { CMakeDriver } from './drivers/driver';
import * as proc from './proc';
import * as nls from 'vscode-nls';
import { Environment } from './environmentVariables';

nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
Expand Down Expand Up @@ -85,7 +86,7 @@ class CustomBuildTaskTerminal implements vscode.Pseudoterminal, proc.OutputConsu
}
private endOfLine: string = "\r\n";

constructor(private command: string, private defaultTargets: string[], private options?: { cwd?: string }, private cmakeDriver?: CMakeDriver) {
constructor(private command: string, private defaultTargets: string[], private options: { cwd?: string ; environment?: Environment } = {}, private cmakeDriver?: CMakeDriver) {
}

output(line: string): void {
Expand Down Expand Up @@ -121,6 +122,7 @@ class CustomBuildTaskTerminal implements vscode.Pseudoterminal, proc.OutputConsu
if (buildCommand) {
cmakePath = buildCommand.command;
args = buildCommand.args ? buildCommand.args : [];
this.options.environment = buildCommand.build_env;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ class ExtensionManager implements vscode.Disposable {
let cache: CMakeCache;
try {
cache = await CMakeCache.fromPath(await cmt.cachePath);
} catch (e) {
} catch (e: any) {
rollbar.exception(localize('filed.to.open.cache.file.on.code.model.update', 'Failed to open CMake cache file on code model update'), e);
return;
}
Expand Down

0 comments on commit d31f5b3

Please sign in to comment.