Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Fix resolving of variables for che commands #373

Merged
merged 2 commits into from
Aug 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions plugins/task-plugin/src/task/che-task-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import { injectable, inject } from 'inversify';
import * as che from '@eclipse-che/plugin';
import { Task } from '@theia/plugin';
import { Task, ShellExecution } from '@theia/plugin';
import { CHE_TASK_TYPE, CheTaskDefinition, Target } from './task-protocol';
import { MachinesPicker } from '../machine/machines-picker';
import { CheWorkspaceClient } from '../che-workspace-client';
Expand Down Expand Up @@ -55,17 +55,20 @@ export class CheTaskProvider {
resultTarget.workingDir = target.workingDir;
}

const command = await che.variables.resolve(cheTaskDefinition.command);
const execution = task.execution as ShellExecution;
if (execution && execution.command) {
execution.command = await che.variables.resolve(execution.command as string);
}

return {
definition: {
type: taskType,
command: command,
target: resultTarget,
previewUrl: cheTaskDefinition.previewUrl
},
name: task.name,
source: task.source,
execution: task.execution
execution: execution
};
}
}
1 change: 0 additions & 1 deletion plugins/task-plugin/src/task/task-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const WORKING_DIR_ATTRIBUTE: string = 'workingDir';

export interface CheTaskDefinition extends TaskDefinition {
readonly target?: Target,
readonly command: string,
readonly previewUrl?: string
}

Expand Down