fix(cli): use more robust url to path conversion
This commit is contained in:
parent
07be4fdb95
commit
803b03fb11
|
@ -4,6 +4,7 @@ import { Contact } from '../src/contact.ts'
|
||||||
import { send } from '../src/send.ts'
|
import { send } from '../src/send.ts'
|
||||||
import type { Mail, Template } from '../types.ts'
|
import type { Mail, Template } from '../types.ts'
|
||||||
import type { JSX } from 'preact'
|
import type { JSX } from 'preact'
|
||||||
|
import { fromFileUrl } from '@std/path'
|
||||||
|
|
||||||
const templates: Map<
|
const templates: Map<
|
||||||
string,
|
string,
|
||||||
|
@ -13,7 +14,8 @@ const templates: Map<
|
||||||
>
|
>
|
||||||
> = new Map()
|
> = new Map()
|
||||||
|
|
||||||
const templatesDir = import.meta.resolve('../templates').slice('file://'.length)
|
const templatesDirUrl = import.meta.resolve('../templates')
|
||||||
|
const templatesDir = fromFileUrl(templatesDirUrl)
|
||||||
|
|
||||||
//Load templates dynamicaly
|
//Load templates dynamicaly
|
||||||
for await (
|
for await (
|
||||||
|
|
Loading…
Reference in a new issue