Skip to content

Commit

Permalink
add sh! function; bump 0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Dec 24, 2018
1 parent 7fbde97 commit 3c9874e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Cumulo Util (WIP)
[![Clojars Project](https://img.shields.io/clojars/v/cumulo/util.svg)](https://clojars.org/cumulo/util)

```edn
[cumulo/util "0.1.5"]
[cumulo/util "0.1.6"]
```

Notice that you will need `shortid` in your project since it's depended on:
Expand All @@ -30,6 +30,7 @@ yarn add shortid
(cumulo-util.file/write-mildly! "a.text" "content")
(cumulo-util.file/get-backup-path!)
(cumulo-util.file/merge-local-edn! {} "a.edn" (fn [found?] (println found?)))
(cumulo-util.file/sh! "ls") ; run shell command

; macros
(cumulo-util.build/get-ip!)
Expand Down
39 changes: 39 additions & 0 deletions calcit.edn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion meyvn.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{:pom {:group-id "cumulo",
:artifact-id "util",
:version "0.1.5",
:version "0.1.6",
:name "Util functions for Cumulo projects"}
:packaging {:jar {:enabled true
:remote-repository {:id "clojars"
Expand Down
2 changes: 2 additions & 0 deletions src/cumulo_util/file.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
(if (fn? handler) (handler found?))
(if found? (read-string (fs/readFileSync filepath "utf8")) nil))))

(defn sh! [command] (println command) (println (.toString (cp/execSync command))))

(defn write-mildly! [file-path content]
(let [do-write! (fn []
(cp/execSync (str "mkdir -p " (path/dirname file-path)))
Expand Down

0 comments on commit 3c9874e

Please sign in to comment.