mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2024-11-16 06:28:32 -06:00
just add the tryImport to both modules
This commit is contained in:
parent
055701f867
commit
b68a35fd78
3 changed files with 11 additions and 11 deletions
|
@ -9,10 +9,13 @@
|
|||
```
|
||||
]##
|
||||
|
||||
|
||||
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.} =
|
||||
illwillDeInit()
|
||||
|
|
|
@ -6,8 +6,11 @@
|
|||
|
||||
import std/[tables]
|
||||
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
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
template tryImport*(x, msg) =
|
||||
const importable = compiles: import x
|
||||
when not importable:
|
||||
{.fatal: msg}
|
||||
else:
|
||||
import x
|
Loading…
Reference in a new issue