(config: Config)
| 37 | } |
| 38 | |
| 39 | export function writeConfig(config: Config) { |
| 40 | const cfg = ConfigSchema.safeParse(config); |
| 41 | if (!cfg.success) { |
| 42 | console.error("Invalid config"); |
| 43 | throw new Error(cfg.error.issues.map((i) => i.message).join("\n")); |
| 44 | } |
| 45 | fs.writeFileSync( |
| 46 | path.resolve(`./${CONFIG}`), |
| 47 | JSON.stringify(cfg.data, null, 2) |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | export const absoluteFilePath = (config: Config, fpath: string) => |
| 52 | path.resolve(config.src || "", fpath); |
no outgoing calls
no test coverage detected