feat: update local files base path
This commit is contained in:
parent
2f095b79c5
commit
ee0c106a2c
|
|
@ -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)/`.
|
||||||
|
|
|
||||||
|
|
@ -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)) {
|
||||||
|
|
|
||||||
|
|
@ -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`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue