just add the tryImport to both modules

This commit is contained in:
Daylin Morgan 2024-09-26 10:41:53 -05:00
parent 055701f867
commit b68a35fd78
Signed by: daylin
GPG key ID: 950D13E9719334AD
3 changed files with 11 additions and 11 deletions

View file

@ -9,10 +9,13 @@
``` ```
]## ]##
import std/[enumerate, os, strutils, sequtils, sets, terminal] import std/[enumerate, os, strutils, sequtils, sets, terminal]
import ./private/tryImport
tryImport(illwill, "hwylterm/choose requires illwill >= 0.4.1") template tryImport*(x, body) =
when not (compiles do: import x): body else: import x
tryImport illwill:
{.fatal: "hwylterm/choose requires illwill >= 0.4.1".}
proc exitProc() {.noconv.} = proc exitProc() {.noconv.} =
illwillDeInit() illwillDeInit()

View file

@ -6,8 +6,11 @@
import std/[tables] import std/[tables]
import ./bbansi import ./bbansi
import ./private/tryImport
tryImport(cligen, "hwylterm/cli requires cligen>= 1.7.5") template tryImport*(x, body) =
when not (compiles do: import x): body else: import x
tryImport cligen:
{.fatal: "hwylterm/cli requires cligen>=1.7.5".}
type type

View file

@ -1,6 +0,0 @@
template tryImport*(x, msg) =
const importable = compiles: import x
when not importable:
{.fatal: msg}
else:
import x