Skip to content

Commit

Permalink
Feat: fix get-cwd and get compiled linux working.
Browse files Browse the repository at this point in the history
* Docs: Notes about compiling on linux.

* Add: try printing dir-files to see result on github actions worker.

* Fix: remove call to new-site 🤦

* Add: try system getProperties - user.dir

* Add: show prints for cwd tests.

* Fix: 🤦 🤦

* Fix: replace get-cwd, with user.dir getProperties
  • Loading branch information
teesloane authored May 18, 2020
1 parent 0173dd3 commit a6be1c3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
13 changes: 8 additions & 5 deletions clojure/src/firn/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,23 @@
"Creates the folders needed for a new site in your wiki directory.
Copies the _firn_starter from resources, into where you are running the cmd."
[{:keys [dir-files]}]
(let [dir-files (if (empty? dir-files) (u/get-cwd) dir-files)
dir-firn (config/make-dir-firn dir-files)
base-dir "firn/_firn_starter/"
read-files (map #(hash-map :contents (slurp (io/resource (str base-dir %)))
:out-name (str dir-firn "/" %)) default-files)]
(let [dir-files (if (empty? dir-files) (u/get-cwd) dir-files)
dir-firn (config/make-dir-firn dir-files)
base-dir "firn/_firn_starter/"
read-files (map #(hash-map :contents (slurp (io/resource (str base-dir %)))
:out-name (str dir-firn "/" %)) default-files)]
(if (fs/exists? dir-firn)
(u/print-err! :error "A _firn directory already exists.")
(do (fs/mkdir dir-firn)
(doseq [f read-files]
(io/make-parents (:out-name f))
(spit (:out-name f) (:contents f)))))))



(defn setup
"Creates folders for output, slurps in layouts and partials.
NOTE: should slurp/mkdir/copy-dir be wrapped in try-catches? if-err handling?"
[{:keys [dir-site dir-files dir-site-data
dir-data dir-site-static dir-static] :as config}]
Expand Down
5 changes: 1 addition & 4 deletions clojure/src/firn/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@
(defn get-cwd
"Because *fs/cwd* gives out the at-the-time jvm path. this works with graal."
[]
(s/join "/" (-> (java.io.File. ".")
.getAbsolutePath
(s/split #"/")
drop-last)))
(System/getProperty "user.dir"))

(defn io-file->keyword
"Turn a filename into a keyword."
Expand Down
10 changes: 10 additions & 0 deletions docs/compiling.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#+TITLE: Compiling

* On Linux

#+BEGIN_SRC
Error: Basic header file missing (<zlib.h>). Make sure headers are available on your system.
com.oracle.svm.core.util.UserError$UserException: Basic header file missing (<zlib.h>). Make sure headers are available on your system.
#+END_SRC

- Try installing [[https://github.com/oracle/graal/issues/957#issuecomment-512801732][zlib]]

0 comments on commit a6be1c3

Please sign in to comment.