Skip to content

Commit 116e2d1

Browse files
committed
update: pass apps as args
1 parent 544ef36 commit 116e2d1

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/workflows/index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ import { workflowData as allWorkflowData } from "./workflows";
1515
4. map units are added along with their workflows according to data in "units"
1616
5. top-level subworkflows are added directly in the order also specified by "units"
1717
*/
18-
function createWorkflowConfigs(appName = null) {
19-
let apps = appName !== null ? [appName] : allApplications;
20-
const allApplicationsFromWorkflowData = Object.keys(allWorkflowData.workflows);
18+
function createWorkflowConfigs(
19+
appName = null,
20+
applications = allApplications,
21+
workflowData = allWorkflowData,
22+
) {
23+
let apps = appName !== null ? [appName] : applications;
24+
const allApplicationsFromWorkflowData = Object.keys(workflowData.workflows);
2125
// output warning if allApplications and allApplicationsFromWorkflowData do not match
2226
if (appName === null) {
2327
if (apps.sort().join(",") !== allApplicationsFromWorkflowData.sort().join(",")) {
@@ -31,14 +35,14 @@ function createWorkflowConfigs(appName = null) {
3135
apps = allApplicationsFromWorkflowData;
3236
}
3337
const wfs = [];
34-
const { workflows } = allWorkflowData;
38+
const { workflows } = workflowData;
3539
apps.map((name) => {
3640
const { [name]: dataByApp } = workflows;
37-
Object.values(dataByApp).map((workflowData) => {
41+
Object.values(dataByApp).map((wfData) => {
3842
wfs.push(
3943
createWorkflowConfig({
4044
appName: name,
41-
workflowData,
45+
workflowData: wfData,
4246
}),
4347
);
4448
return null;

0 commit comments

Comments
 (0)