~technomancy/polywell

9e32e3c0ed206791b3d9fff384df83a31736dc67 — Phil Hagelberg 3 months ago aebb8a1 main
Make socket and lfs optional dependencies.
2 files changed, 4 insertions(+), 4 deletions(-)

M config/nrepl-mode.fnl
M polywell/frontend/term.fnl
M config/nrepl-mode.fnl => config/nrepl-mode.fnl +1 -1
@@ 1,5 1,5 @@
(local editor (require :polywell))
(local socket (require :socket))
(local (socket-ok? socket) (pcall require :socket))
(local bencode (require :config.bencode))
(local lume (require :polywell.lib.lume))


M polywell/frontend/term.fnl => polywell/frontend/term.fnl +3 -3
@@ 1,6 1,6 @@
(local term (require :polywell.lib.plterm))
(local lume (require :polywell.lib.lume))
(local lfs (require :lfs))
(local (lfs-ok? lfs) (pcall require :lfs))

(var clipboard "")



@@ 60,7 60,7 @@
        (term.golc (- b.point-line scroll-line -1) (+ 1 b.point)))))

(fn resolve [path]
  (if (not (path:find "^/"))
  (if (and lfs-ok? (not (path:find "^/")))
      (.. (lfs.currentdir) "/" path)
      path))



@@ 86,7 86,7 @@
      (f:write contents))))

(fn type* [path]
  (. (or (lfs.attributes (resolve path)) []) :mode))
  (and lfs-ok? (. (or (lfs.attributes (resolve path)) []) :mode)))

(fn get-wh []
  (let [(h w) (term.getscrlc)]