Fork me on GitHub
#babashka
<
2020-02-02
>
sogaiu05:02:51

your fs utils look like they could be quite handy!

sogaiu10:02:01

looking at your tests i appreciate them as they look to be giving usage examples and expression of behavioral intent :thumbsup:

borkdude11:02:53

@deleted-user Cool! I'll wait for the official announcement and some docs, then we could add it to the README of babashka?

👍 4
borkdude12:02:17

handy script for generating the most recent entry from a gitlib for deps.edn:

#!/usr/bin/env bb

(require '[clojure.java.shell :refer [sh]]
         '[clojure.string :as str])

(let [[username project branch] *command-line-args*
      branch (or branch "master")
      url (str "" username "/" project)
      sha (-> (sh "git" "ls-remote" url branch)
              :out
              (str/split #"\s")
              first)]
  {:git/url url
   :sha sha})
$ gitlib.clj nate fs
{:git/url "", :sha "75b9fcd399ac37cb4f9752a4c7a6755f3fbbc000"}
$ clj -Sdeps "{:deps {fs $(gitlib.clj nate fs)}}" -e "(require '[nate.fs :as fs]) (fs/creation-time \".\")"
#object[java.nio.file.attribute.FileTime 0x5c748168 "2019-07-05T14:06:26Z"]

👍 8
nate20:02:34

woah, TIL about git ls-remote...

nate20:02:39

that's nifty