mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
fix: a bunch of stupid things
This commit is contained in:
1 parent
55e6599eaa
commit
6d6a634973
4 files changed
+21
-11
No files matched your search
@@ -1,9 +1,20 @@
|
||||
import { readFile } from 'fs/promises';
|
||||
import { DATA_COMPRESSED } from '../../buildAssets/constants';
|
||||
import { readDVPL } from './readDVPL';
|
||||
|
||||
export async function readDVPLFile(file: string) {
|
||||
const path = `${file}${file.endsWith('.dvpl') ? '' : '.dvpl'}`;
|
||||
let path: string;
|
||||
|
||||
if (DATA_COMPRESSED) {
|
||||
path = file.endsWith('.dvpl') ? file : `${file}.dvpl`;
|
||||
} else {
|
||||
path = file.replace('.dvpl', '');
|
||||
}
|
||||
|
||||
const content = await readFile(path);
|
||||
|
||||
if (!DATA_COMPRESSED) return content;
|
||||
|
||||
const dvpl = readDVPL(content);
|
||||
|
||||
return dvpl;
|
||||
|
||||
Reference in new issue
Block a user