(filepath: string)
| 993 | }) |
| 994 | |
| 995 | async function loadFile(filepath: string): Promise<Info> { |
| 996 | log.info("loading", { path: filepath }) |
| 997 | let text = await Bun.file(filepath) |
| 998 | .text() |
| 999 | .catch((err) => { |
| 1000 | if (err.code === "ENOENT") return |
| 1001 | throw new JsonError({ path: filepath }, { cause: err }) |
| 1002 | }) |
| 1003 | if (!text) return {} |
| 1004 | return load(text, filepath) |
| 1005 | } |
| 1006 | |
| 1007 | async function load(text: string, configFilepath: string) { |
| 1008 | text = text.replace(/\{env:([^}]+)\}/g, (_, varName) => { |