feat: 文件支持脚本操作

This commit is contained in:
xream
2024-01-12 06:16:39 +08:00
parent 9ae70eca09
commit c059296224
5 changed files with 52 additions and 10 deletions

View File

@@ -331,7 +331,10 @@ async function produceArtifact({
} else if (type === 'file') {
const allFiles = $.read(FILES_KEY);
const file = findByName(allFiles, name);
return file?.content ?? '';
if (!file) throw new Error(`找不到文件 ${name}`);
let content = file.content ?? '';
content = await ProxyUtils.process(content, file.process || []);
return content ?? '';
}
}