mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
fix: path normalization
This commit is contained in:
1 parent
9cb1d0cb3f
commit
d633874d90
4 files changed
+9
-7
No files matched your search
@@ -1,4 +1,5 @@
|
|||||||
import { XMLParser } from "fast-xml-parser";
|
import { XMLParser } from "fast-xml-parser";
|
||||||
|
import { normalize } from "path/posix";
|
||||||
import SteamUser, { EConnectionProtocol } from "steam-user";
|
import SteamUser, { EConnectionProtocol } from "steam-user";
|
||||||
import { parse } from "yaml";
|
import { parse } from "yaml";
|
||||||
import { readDVPL } from "../blitz";
|
import { readDVPL } from "../blitz";
|
||||||
@@ -81,11 +82,12 @@ export class SteamVFS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
has(path: string) {
|
has(path: string) {
|
||||||
const dvplPath = `${path}.dvpl`;
|
const normalized = normalize(path);
|
||||||
|
const dvplPath = `${normalized}.dvpl`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
(this.manifest.has(dvplPath) && dvplPath) ||
|
(this.manifest.has(dvplPath) && dvplPath) ||
|
||||||
(this.manifest.has(path) && path)
|
(this.manifest.has(normalized) && normalized)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -577,7 +577,7 @@ export async function definitions() {
|
|||||||
.then((response) => response.text())
|
.then((response) => response.text())
|
||||||
.then((string) => parseYaml(string) as BlitzStrings);
|
.then((string) => parseYaml(string) as BlitzStrings);
|
||||||
const preInstalled = await vfs.yaml<BlitzStrings>(
|
const preInstalled = await vfs.yaml<BlitzStrings>(
|
||||||
'Data/Strings/${blitzLocale}.yaml'
|
`Data/Strings/${blitzLocale}.yaml`
|
||||||
);
|
);
|
||||||
|
|
||||||
stringsI18n[locale] = {
|
stringsI18n[locale] = {
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ export async function readTexture(path: string) {
|
|||||||
const resolvedTexturePath = isDds
|
const resolvedTexturePath = isDds
|
||||||
? ddsTexturePath
|
? ddsTexturePath
|
||||||
: ddsTexturePath.replace(".dds", ".pvr");
|
: ddsTexturePath.replace(".dds", ".pvr");
|
||||||
const decompressedDvpl = await vfs.file(`${resolvedTexturePath}.dvpl`);
|
const file = await vfs.file(resolvedTexturePath);
|
||||||
|
|
||||||
const raw = isDds
|
const raw = isDds
|
||||||
? await new DdsReadStream(decompressedDvpl.buffer as ArrayBuffer).dds()
|
? await new DdsReadStream(file.buffer as ArrayBuffer).dds()
|
||||||
: new PvrReadStream(decompressedDvpl.buffer as ArrayBuffer).pvr();
|
: new PvrReadStream(file.buffer as ArrayBuffer).pvr();
|
||||||
|
|
||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ export class AssetUploader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (diff.status === DiffStatus.Unchanged) {
|
if (diff.status === DiffStatus.Unchanged) {
|
||||||
// console.log(`🔵 ${change.path}`);
|
console.log(`🔵 ${change.path}`);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
`${diff.status === DiffStatus.New ? "🟢" : "🟡"} (${
|
`${diff.status === DiffStatus.New ? "🟢" : "🟡"} (${
|
||||||
|
|||||||
Reference in new issue
Block a user