Merge pull request #35 from nuomiaa/patch-1

修复 TXT配置文件类型无法写入空的BUG
This commit is contained in:
Unitwk 2022-10-07 10:21:15 +08:00 committed by GitHub
commit 7eb6664c07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,7 @@ export class ProcessConfig {
if (this.iProcessConfig.type === "txt") {
text = object.toString();
}
if (!text) throw new Error($t("process_config.writEmpty"));
if (!text && this.iProcessConfig.type !== "txt") throw new Error($t("process_config.writEmpty"));
fs.writeFileSync(this.iProcessConfig.path, text, { encoding: CONFIG_FILE_ENCODE });
}