Skip to content

Commit

Permalink
Fix missing parent dir bug when fetching include files
Browse files Browse the repository at this point in the history
  • Loading branch information
julienvincent committed Oct 29, 2023
1 parent e443251 commit 70f9f11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 0 additions & 3 deletions src/k16/kl/api/fs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
(defn from-submodule-dir ^java.io.File [group-name module-name & segments]
(from-submodule-work-dir group-name ".modules" (name module-name) (flatten segments)))

(defn from-submodule-build-dir ^java.io.File [group-name module-name & segments]
(from-submodule-dir group-name module-name "build" segments))

(defn read-edn [^java.io.File file]
(try
(edn/read-string (slurp file))
Expand Down
13 changes: 6 additions & 7 deletions src/k16/kl/api/resolver/downloader.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
(:require
[cli-matic.utils :as cli.util]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.string :as str]
[k16.kl.api.fs :as api.config]
[k16.kl.api.fs :as api.fs]
[k16.kl.api.github :as api.github]
[k16.kl.log :as log]
[promesa.core :as p]))
Expand Down Expand Up @@ -37,12 +36,12 @@
:or {subdir ".kl"}} module
sha-short (subs sha 0 7)

build-dir (-> (api.config/from-submodule-build-dir group-name module-name)
.toString)
submodule-dir (-> (api.fs/from-submodule-dir group-name module-name)
.toString)

vars {:SHA sha
:SHA_SHORT sha-short
:DIR build-dir}]
:DIR submodule-dir}]

(log/info (str "Downloading " url "@" sha-short))

Expand All @@ -57,6 +56,6 @@
(log/info (str "Downloading " file " [" module-name "]"))
(let [contents (-> (read-repo-file url sha (relative-to subdir file))
(replace-vars vars))]
(spit (io/file build-dir file) contents)))))))
(spit (api.fs/from-submodule-dir group-name module-name file) contents)))))))

(api.config/write-edn (api.config/from-submodule-dir group-name module-name "module.edn") config))))
(api.fs/write-edn (api.fs/from-submodule-dir group-name module-name "module.edn") config))))

0 comments on commit 70f9f11

Please sign in to comment.