Add isFile() check before reading config to give a clear error message
when Docker creates a directory instead of mounting a missing file.
Fixes #2
-import { existsSync, readFileSync } from "node:fs";
+import { existsSync, readFileSync, statSync } from "node:fs";
import { parse as parseYaml } from "yaml";
import { z } from "zod";
for (const path of paths) {
if (existsSync(path)) {
+ if (!statSync(path).isFile()) {
+ throw new Error(
+ `'${path}' is a directory, not a file. Run: cp config.example.yaml config.yaml`,
+ );
+ }
configFile = readFileSync(path, "utf-8");
break;
}