haperone_local-image-compress/scripts/repository-layout.js
haperone 3355a902aa fix: bind timers to their owning windows
fix: make cache unload replay authoritative
2026-06-15 21:23:29 +02:00

22 lines
616 B
JavaScript

"use strict";
const fs = require("fs");
const path = require("path");
function resolveRepositoryLayout(scriptDirectory = __dirname) {
const sourceRoot = path.resolve(scriptDirectory, "..");
const parentRoot = path.resolve(sourceRoot, "..");
const isDevLayout = path.basename(sourceRoot) === "source-recovery"
&& fs.existsSync(path.join(sourceRoot, "src-ts"))
&& fs.existsSync(path.join(parentRoot, "manifest.json"));
const repositoryRoot = isDevLayout ? parentRoot : sourceRoot;
return {
isDevLayout,
repositoryRoot,
sourceRoot
};
}
module.exports = {
resolveRepositoryLayout
};