mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 15:52:55 +01:00
feat: lenient strings
This commit is contained in:
1 parent
3b757562d2
commit
32b5593d07
2 files changed
+13
-6
No files matched your search
@@ -11,7 +11,7 @@ const TS_PROTO_EXECUTABLE_LOCATIONS = [
|
|||||||
|
|
||||||
const roots = [
|
const roots = [
|
||||||
// "../../packages/core/src/protos",
|
// "../../packages/core/src/protos",
|
||||||
// "../../packages/closed/protos",
|
"../../packages/closed/protos",
|
||||||
"../../packages/website-ue/src/protos",
|
"../../packages/website-ue/src/protos",
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ for (const root of roots) {
|
|||||||
|
|
||||||
if (command.length + newLine.length < MAX_COMMAND_LENGTH) {
|
if (command.length + newLine.length < MAX_COMMAND_LENGTH) {
|
||||||
command += newLine;
|
command += newLine;
|
||||||
files.pop();
|
console.log(` ${files.pop()}`);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,12 +53,13 @@ export class ServerAPI extends AbstractAPI {
|
|||||||
throw new Error("No suitable production remote storage found");
|
throw new Error("No suitable production remote storage found");
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = await fetch(
|
const strings: Record<string, string> = {};
|
||||||
`${remoteStorage.url}/${remoteStorage.relative_path}/config.yaml`
|
const configPath = `${remoteStorage.url}/${remoteStorage.relative_path}/config.yaml`;
|
||||||
)
|
|
||||||
|
try {
|
||||||
|
const config = await fetch(configPath)
|
||||||
.then((response) => response.text())
|
.then((response) => response.text())
|
||||||
.then((text) => parse(text) as LocalizationConfig);
|
.then((text) => parse(text) as LocalizationConfig);
|
||||||
const strings: Record<string, string> = {};
|
|
||||||
|
|
||||||
for (const namespace of config.namespaces) {
|
for (const namespace of config.namespaces) {
|
||||||
Object.assign(
|
Object.assign(
|
||||||
@@ -79,6 +80,12 @@ export class ServerAPI extends AbstractAPI {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn(
|
||||||
|
`Failed to fetch config from ${configPath}. Returning empty strings. This will throw an error in production. Error:`,
|
||||||
|
error
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user