fix(cli): use more robust url to path conversion

This commit is contained in:
Julien Oculi 2024-04-03 17:11:03 +02:00
parent 07be4fdb95
commit 803b03fb11

View file

@ -4,6 +4,7 @@ import { Contact } from '../src/contact.ts'
import { send } from '../src/send.ts'
import type { Mail, Template } from '../types.ts'
import type { JSX } from 'preact'
import { fromFileUrl } from '@std/path'
const templates: Map<
string,
@ -13,7 +14,8 @@ const templates: 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
for await (