| 101 | return join(reportComponentList, ','); |
| 102 | } |
| 103 | private async updateComponent(context: IContext) { |
| 104 | let executedComponent = filter(get(context, 'steps'), item => item.status === STEP_STATUS.SUCCESS); |
| 105 | executedComponent = uniqBy(executedComponent, item => item.component); |
| 106 | for (const item of executedComponent) { |
| 107 | const instance = await loadComponent(item.component, { logger }); |
| 108 | const lockPath = utils.getLockFile(instance.__path); |
| 109 | const lockInfo = utils.readJson(lockPath); |
| 110 | if (!lockInfo.lastUpdateCheck || Date.now() - lockInfo.lastUpdateCheck > UPDATE_COMPONENT_CHECK_INTERVAL) { |
| 111 | execDaemon('update-component.js', { component: item.component }); |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | // 当输出只有一条时,舍去key |
| 116 | private parseOutput(data: Object) { |
| 117 | if (keys(data).length === 1) return data[keys(data)[0]]; |