feat: update local files base path

This commit is contained in:
Julien Oculi 2025-02-20 16:38:54 +01:00
parent 2f095b79c5
commit ee0c106a2c
3 changed files with 7 additions and 2 deletions

View file

@ -42,3 +42,8 @@ deno install \
# OR # OR
./cohamail <subcommand> -h ./cohamail <subcommand> -h
``` ```
## Configuration
You can override default config and templates with your own in
`/etc/cohabit/mailer/(config|templates)/`.

View file

@ -19,7 +19,7 @@ for (const template of Object.values(defaultTemplates)) {
} }
//Load local templates //Load local templates
const basePath = '/etc/cohabit/mailer' const basePath = '/etc/cohabit/mailer/templates'
if (await exists(basePath)) { if (await exists(basePath)) {
for await (const template of Deno.readDir(basePath)) { for await (const template of Deno.readDir(basePath)) {

View file

@ -37,7 +37,7 @@ async function readJsonFile<
return { ...defaultValue, ...json } return { ...defaultValue, ...json }
} }
const basePath = '/ect/cohabit/mailer' const basePath = '/ect/cohabit/mailer/config'
export const accounts = await readJsonFile<AccountRecord>( export const accounts = await readJsonFile<AccountRecord>(
`${basePath}/account.json`, `${basePath}/account.json`,