Fork me on GitHub
#babashka
<
2020-02-02
>
nate_clojurians01:02:32

here's my filesystem shim that I want to get working with babashka https://github.com/nate/fs/blob/master/src/nate/fs.clj

nate_clojurians01:02:55

it's not 100% tested quite yet

nate_clojurians01:02:56

but I think all I'll be adding is a posix-ish shim so you can do stuff like (ls path) or (touch path) or (cp-r path1 path2) and similar

sogaiu05:02:51

your fs utils look like they could be quite handy!

nate_clojurians06:02:52

the testing is such a slog, though

sogaiu10:02:01

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

borkdude11:02:53

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

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"]

nate20:02:34

woah, TIL about git ls-remote...

nate20:02:39

that's nifty