feat: 同步配置支持文件

This commit is contained in:
xream
2024-01-12 03:52:41 +08:00
parent d0acf49b83
commit 9ae70eca09
2 changed files with 6 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import {
COLLECTIONS_KEY,
RULES_KEY,
SUBS_KEY,
FILES_KEY,
} from '@/constants';
import { failed, success } from '@/restful/response';
import { InternalServerError, ResourceNotFoundError } from '@/restful/errors';
@@ -327,6 +328,10 @@ async function produceArtifact({
]);
// produce output
return RuleUtils.produce(rules, platform);
} else if (type === 'file') {
const allFiles = $.read(FILES_KEY);
const file = findByName(allFiles, name);
return file?.content ?? '';
}
}