fix(utf8): закрыть lossy-границы конфигурации и API
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
import { parseUpstreamHashes } from "../src/build/hysteriaRelease";
|
||||
import { readText } from "../src/lib/fs";
|
||||
|
||||
function fail(message: string): never {
|
||||
console.error(`[hy2xs-build] ERROR: ${message}`);
|
||||
@@ -47,7 +48,7 @@ function parseArgs(argv: string[]): { file: string; asset: string } {
|
||||
const { file, asset } = parseArgs(Bun.argv.slice(2));
|
||||
|
||||
try {
|
||||
const text = await Bun.file(file).text();
|
||||
const text = await readText(file);
|
||||
process.stdout.write(`${parseUpstreamHashes(text, asset)}\n`);
|
||||
} catch (error) {
|
||||
fail(error instanceof Error ? error.message : String(error));
|
||||
|
||||
Reference in New Issue
Block a user