This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export configurations of Che tasks to config file
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
- Loading branch information
1 parent
5782188
commit 0fe8fa0
Showing
11 changed files
with
413 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
plugins/task-plugin/src/extract/che-task-configs-extractor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
**********************************************************************/ | ||
|
||
import { injectable } from 'inversify'; | ||
import { che as cheApi } from '@eclipse-che/api'; | ||
import { TaskConfiguration } from '@eclipse-che/plugin'; | ||
import { toTaskConfiguration } from '../task/converter'; | ||
import { VSCODE_TASK_TYPE } from './vscode-task-configs-extractor'; | ||
import { VSCODE_LAUNCH_TYPE } from './vscode-launch-configs-extractor'; | ||
|
||
/** Extracts CHE configurations of tasks. */ | ||
@injectable() | ||
export class CheTaskConfigsExtractor { | ||
|
||
extract(commands: cheApi.workspace.Command[]): TaskConfiguration[] { | ||
// TODO filter should be changed according to task type after resolving https://github.com/eclipse/che/issues/12710 | ||
const filteredCommands = commands.filter(command => | ||
command.type !== VSCODE_TASK_TYPE && | ||
command.type !== VSCODE_LAUNCH_TYPE); | ||
|
||
if (filteredCommands.length === 0) { | ||
return []; | ||
} | ||
|
||
return filteredCommands.map(command => toTaskConfiguration(command)); | ||
} | ||
} |
Oops, something went wrong.