Skip to content

Commit

Permalink
2.7.3 workflow job env fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobaidadada committed Feb 5, 2025
1 parent 33346d3 commit 3c75f67
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 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.2",
"version": "2.7.3",
"description": "filecat 文件管理器",
"author": "xiaobaidadada",
"scripts": {
Expand Down
22 changes: 11 additions & 11 deletions src/main/domain/file/workflow/workflow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,17 @@ class work_children {
public async run_job(job: job_item) {
try {
if(!job.if || vm.runInContext(job.if,sandbox_context)) {
if(job['sys-env']) {
for (const key of Object.keys(job['sys-env'])) {
job['sys-env'][key] = Mustache.render(`${job['sys-env'][key]??""}`, this.env??{});
}
}
if(job.env) {
for (const key of Object.keys(job.env)) {
job.env[key] = Mustache.render(`${job.env[key]??""}`, this.env??{});
}
}
job.cwd = Mustache.render(job.cwd??"", {...this.env,...job.env});
job.running_type = running_type.running;
// 目录处理判断
if (!path.isAbsolute(job.cwd)) {
Expand Down Expand Up @@ -364,17 +375,6 @@ class work_children {
}
}
let out_context = "";
if(job['sys-env']) {
for (const key of Object.keys(job['sys-env'])) {
job['sys-env'][key] = Mustache.render(`${job['sys-env'][key]??""}`, this.env??{});
}
}
if(job.env) {
for (const key of Object.keys(job.env)) {
job.env[key] = Mustache.render(`${job.env[key]??""}`, this.env??{});
}
}
job.cwd = Mustache.render(job.cwd??"", {...this.env,...job.env});
userService.check_user_path_by_user_id(this.user_id, job.cwd);
const PATH = process.env.PATH +(sysType === "win" ? ";" : ":") + settingService.get_env_list();
const ptyshell = new PtyShell({
Expand Down

0 comments on commit 3c75f67

Please sign in to comment.