12345678910111213141516171819202122232425262728293031 |
- (import-macros {: self! : for! } :macros)
- (local fennel (require :fennel))
- (local self* (self!))
- (let [pkg-paths [:path :macro-path]]
- ((. table :insert)
- (or (. package :loaders) (. package :searchers))
- (. fennel :searcher))
- (for! i pkg-paths
- (tset fennel i
- (..
- (.. self* "fnl/?.fnl")
- ";"
- (.. self* "fnl/?/init.fnl")
- ";"
- (. fennel i)))))
- (let [{:loop {: fs_scandir : fs_scandir_next : fs_closedir}} vim
- dir-path (.. self* :fnl/config/)]
- (var dir (fs_scandir dir-path))
- (while dir
- (let [(name t) (fs_scandir_next dir)]
- (if name
- (when (and (= :file t)
- (= :.fnl (: name :sub -4))
- (not= :. (: name :sub 1 1)))
- ((. fennel :dofile) (.. dir-path name)))
- (set dir nil)))))
|