diff --git a/project.clj b/project.clj index e6a4069..46cf6e7 100644 --- a/project.clj +++ b/project.clj @@ -3,7 +3,8 @@ :url "http://example.com/FIXME" :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0" :url "https://www.eclipse.org/legal/epl-2.0/"} - :dependencies [[org.clojure/clojure "1.11.1"]] + :dependencies [[org.clojure/clojure "1.11.1"] + [babashka/fs "0.1.6"]] :plugins [[lein-cljfmt "0.8.0"]] :repl-options {:init-ns ludus.core} :main ludus.core diff --git a/src/ludus/loader.clj b/src/ludus/loader.clj new file mode 100644 index 0000000..12ccc17 --- /dev/null +++ b/src/ludus/loader.clj @@ -0,0 +1,12 @@ +(ns ludus.loader + (:require [babashka.fs :as fs])) + +(defn cwd [] (fs/cwd)) + +(defn load-import + ([file] (-> file (fs/canonicalize) (fs/file) (slurp))) + ([file from] + (load-import + (fs/path + (fs/parent (fs/canonicalize from)) + (fs/path file)))))