feat(scanner): complete localized artifact quality checkpoint

This commit is contained in:
AzuTear
2026-07-11 15:59:19 +02:00
parent 639b0b7f59
commit 8b9f948c6b
215 changed files with 35440 additions and 7273 deletions
+53
View File
@@ -0,0 +1,53 @@
import path from "node:path";
export interface RuntimeResourcePathOptions {
isPackaged: boolean;
resourcesPath: string;
currentWorkingDirectory: string;
appPath: string;
overridePath?: string;
}
function uniqueCandidates(candidates: Array<string | undefined>) {
return candidates.filter((candidate, index, all): candidate is string => (
Boolean(candidate) && all.indexOf(candidate) === index
));
}
export function inputHelperPathCandidates({
isPackaged,
resourcesPath,
currentWorkingDirectory,
appPath,
overridePath,
}: RuntimeResourcePathOptions) {
const packagedPath = path.join(resourcesPath, "input-helper", "InputHelper.exe");
const developmentPaths = [
path.join(currentWorkingDirectory, "native", "input-helper", "bin", "publish", "InputHelper.exe"),
path.join(appPath, "native", "input-helper", "bin", "publish", "InputHelper.exe"),
];
return uniqueCandidates([
overridePath,
...(isPackaged ? [packagedPath] : [...developmentPaths, packagedPath]),
]);
}
export function ikInventoryListsPathCandidates({
isPackaged,
resourcesPath,
currentWorkingDirectory,
appPath,
overridePath,
}: RuntimeResourcePathOptions) {
const packagedPath = path.join(resourcesPath, "ik-inventorylists");
const developmentPaths = [
path.join(currentWorkingDirectory, "data", "ik-inventorylists"),
path.join(appPath, "data", "ik-inventorylists"),
];
return uniqueCandidates([
overridePath,
...(isPackaged ? [packagedPath] : [...developmentPaths, packagedPath]),
]);
}