1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-11 01:10:25 +00:00

Exit early when filewatch is not supported.

Currently we have no poll implementation.
This commit is contained in:
Calvin Rose 2024-08-18 16:25:47 -05:00
parent c0e508e334
commit 9e334da2d6

View File

@ -27,6 +27,12 @@
(def is-win (or (= :mingw (os/which)) (= :windows (os/which))))
(def is-linux (= :linux (os/which)))
# If not supported, exit early
(def [supported msg] (protect (filewatch/new chan)))
(when (and (not supported) (string/find "filewatch not supported" msg))
(end-suite)
(quit))
# Test GC
(assert-no-error "filewatch/new" (filewatch/new chan))
(gccollect)