-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathpreload.pxi
More file actions
21 lines (19 loc) · 910 Bytes
/
preload.pxi
File metadata and controls
21 lines (19 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(ns pixie.preload
(require pixie.string :as s))
(defn load-all-pxi-files
"Only used by preloading, loads all found .pxi files"
[]
(println "Looking for pxi files...")
(foreach [path @load-paths]
(println "Looking for files in:" path)
(foreach [desc (pixie.path/file-list path)]
(if (= (nth desc 1) :file)
(let [filename (nth desc 2)]
(if (and (pixie.string/ends-with filename ".pxi")
(not (= filename "preload.pxi"))
(not (= filename "stdlib.pxi")))
(if (pixie.string/starts-with (nth desc 0) "./pixie")
(let [fullpath (str (nth desc 0) "/" filename)]
(println "Loading" fullpath)
(load-file fullpath)))))))))
(load-all-pxi-files)