Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust parser CLI for compatibility with Linux dev #75

Merged
merged 6 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added clojure/resources/parser-dev-linux
Binary file not shown.
File renamed without changes.
6 changes: 4 additions & 2 deletions clojure/src/firn/org.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(ns firn.org


"The org namespace handles all data-related to the parsing of an org file.
When an org file is parsed it is organized into a map of data.
Expand Down Expand Up @@ -50,7 +52,7 @@
[file-str]
(if (u/native-image?)
(ClojureRust/parseOrg file-str)
(let [parser (str (u/get-cwd) "/resources/parser")
(let [parser (str (u/get-cwd) "/resources/parser-dev-" (u/get-os))
stripped (s/trim-newline file-str)
res (sh/sh parser stripped)]
(if-not (= (res :exit) 0)
Expand All @@ -60,7 +62,7 @@
(defn parse-dev!
"DevXp func: Useful for testing org strings in the repl."
[s]
(let [parser (str (u/get-cwd) "/resources/parser")
(let [parser (str (u/get-cwd) "/resources/parser-dev-" (u/get-os))
stripped (s/trim-newline s)
res (sh/sh parser stripped)]
(if-not (= (res :exit) 0)
Expand Down
6 changes: 6 additions & 0 deletions clojure/src/firn/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
[]
(System/getProperty "user.dir"))

(defn get-os
"Return the name of the host operating system."
[]
(str/replace (str/lower-case (System/getProperty "os.name"))
#" " ""))

(defn snake->kebab
"Convert strings with underscores to hyphens."
([s]
Expand Down
2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ crate_type = ["cdylib"]

[dependencies]
jni = "0.14.0"
heim = "0.0.10"
heim = "0.0.11"
futures = "0.3.1"
orgize = "0.8.3"
serde_json = "1.0.48"