Skip to content

Commit

Permalink
2.7.4 workflow fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobaidadada committed Feb 5, 2025
1 parent 3c75f67 commit ba37a10
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filecat",
"version": "2.7.3",
"version": "2.7.4",
"description": "filecat 文件管理器",
"author": "xiaobaidadada",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/main/domain/file/workflow/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
sys-env: # 这里的token 会在执行的添加到shell的环境变量中
token: {{{token}}}
env:
temp: {{token}}123 # 用于设置一些临时变量
temp: '{{token}}123' # 用于设置一些临时变量
steps: # 这些脚本会按顺序执行
- use-yml: test2 # 使用其它 yml 文件中的 name
with-env:
Expand Down
8 changes: 7 additions & 1 deletion src/main/domain/file/workflow/workflow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ class work_children {
// 执行另一个文件
const yaml = this.import_files_map.get(step["use-yml"]);
if(yaml) {
if(step['with-env']) {
for (const key of Object.keys(step['with-env'])) {
step['with-env'][key] = Mustache.render(`${step['with-env'][key]??""}`, {...this.env,...job.env});
}
}
const worker = new work_children(undefined, this.workflow_dir_path);
await worker.init({
env:step['with-env'],
Expand Down Expand Up @@ -538,12 +543,13 @@ class work_children {
step.duration = `${((Date.now() - step_satrt_time) / 1000).toFixed(2)} s`;
step.code = code as number;
step.running_type = running_type.success;
this.send_all_wss();
if(code !==0 ) {
step.running_type = running_type.fail;
// 终止后面的行为
this.send_all_wss();
break;
}
this.send_all_wss();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ export function WorkFlow(props) {
}
} else if(job_list) {
for (const item of job_list??[]){
const name = <div><StatusCircle success={item.code === undefined?undefined:item.code === 0} />${item.name}</div>
r_list.push({
name:item.name,
name:name,
extra_data: {code:item.code,is_job:true,job_data:item}
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/web/project/component/prompts/FileNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
sys-env: # 这里的token 会在执行的添加到shell的环境变量中
token: {{{token}}}
env:
temp: {{token}}123 # 用于设置一些临时变量
temp: '{{token}}123' # 用于设置一些临时变量
steps: # 这些脚本会按顺序执行
- use-yml: test2 # 使用其它 yml 文件中的 name
with-env:
Expand Down

0 comments on commit ba37a10

Please sign in to comment.