From fd05f0ebb95a3e4277a72eb47f6be6d1b831e60f Mon Sep 17 00:00:00 2001 From: Emil HAMMARSTEDT Date: Fri, 1 Oct 2021 09:50:57 +0200 Subject: [PATCH 1/2] Expand variables in env section of tasks.json using variableResolverService Fixes #10207 Contributed by STMicroelectronics Signed-off-by: Emil HAMMARSTEDT --- packages/task/src/browser/process/process-task-resolver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/task/src/browser/process/process-task-resolver.ts b/packages/task/src/browser/process/process-task-resolver.ts index 1be9e053bb232..abf85b25461e7 100644 --- a/packages/task/src/browser/process/process-task-resolver.ts +++ b/packages/task/src/browser/process/process-task-resolver.ts @@ -80,7 +80,7 @@ export class ProcessTaskResolver implements TaskResolver { } : undefined, options: { cwd: await this.variableResolverService.resolve(cwd, variableResolverOptions), - env: processTaskConfig.options && processTaskConfig.options.env, + env: await this.variableResolverService.resolve(processTaskConfig.options && processTaskConfig.options.env, variableResolverOptions), shell: processTaskConfig.options && processTaskConfig.options.shell } }; From 6d489260e991694437891affed954db6da63fad8 Mon Sep 17 00:00:00 2001 From: Paul Marechal Date: Wed, 24 Nov 2021 18:39:14 -0500 Subject: [PATCH 2/2] skip resolve if undefined --- packages/task/src/browser/process/process-task-resolver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/task/src/browser/process/process-task-resolver.ts b/packages/task/src/browser/process/process-task-resolver.ts index abf85b25461e7..0b8b10e99c031 100644 --- a/packages/task/src/browser/process/process-task-resolver.ts +++ b/packages/task/src/browser/process/process-task-resolver.ts @@ -80,7 +80,7 @@ export class ProcessTaskResolver implements TaskResolver { } : undefined, options: { cwd: await this.variableResolverService.resolve(cwd, variableResolverOptions), - env: await this.variableResolverService.resolve(processTaskConfig.options && processTaskConfig.options.env, variableResolverOptions), + env: processTaskConfig.options?.env && await this.variableResolverService.resolve(processTaskConfig.options.env, variableResolverOptions), shell: processTaskConfig.options && processTaskConfig.options.shell } };