Skip to content

Commit

Permalink
Merge pull request #25 from kepler16/fix/cp-for-root
Browse files Browse the repository at this point in the history
fix: cp for root
  • Loading branch information
armed authored May 21, 2024
2 parents c619c0a + 4d9057c commit e227392
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/k16/kmono/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
(defn- create-config
[repo-root glob]
(let [package-dirs (conj (fs/glob repo-root glob)
(fs/absolutize (fs/path repo-root)))]
(-> (fs/path repo-root)
(fs/normalize)
(fs/absolutize)))]
{:packages (->> package-dirs
(map (partial create-package-config repo-root glob))
(remove nil?)
Expand Down
11 changes: 8 additions & 3 deletions src/k16/kmono/repl/deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
{:root root
:package-dir package-dir
:path path})
(fs/relativize root (fs/path package-dir path)))
(if (fs/same-file? root package-dir)
(fs/path package-dir path)
(fs/relativize root (fs/path package-dir path))))

(defn- strip-extra-parent
"JRE 8 workaround"
Expand Down Expand Up @@ -100,8 +102,11 @@
(let [package-dirs (->> config
:packages
(map (fn [pkg]
[(fs/file-name (fs/path (:dir pkg)))
(:dir pkg)]))
[(fs/file-name (fs/normalize
(fs/path (:dir pkg))))
(-> (:dir pkg)
(fs/normalize)
(str))]))
(into {}))
package-deps (all-packages-deps-alias (:packages config))
package-alias-pairs' (expand-package-alias-pairs
Expand Down
10 changes: 6 additions & 4 deletions test/k16/kmono/test_utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@

(defn shell-commands! [cmds]
(into {}
(map (fn [cmd]
[cmd (bp/shell {:dir repo-root
:out :string} cmd)]))
cmds))
(mapv (fn [cmd]
(let [result (bp/shell {:dir repo-root
:out :string} cmd)]
(Thread/sleep 20)
[cmd result]))
cmds)))

(defn initialize-git! []
(shell-commands! ["git init -q --initial-branch=main"
Expand Down

0 comments on commit e227392

Please sign in to comment.