Fork me on GitHub
#babashka
<
2019-12-30
>
borkdude00:12:27

is there maybe a new way of doing this in Java in nio?

borkdude00:12:59

it seems useful for babashka to be able to do this, so we can maybe hack a special case for reify and this class together... not sure, have to think about it

borkdude00:12:37

I guess there are also other ways of filtering files? like with normal clojure functions?

borkdude00:12:09

oh I see 🙂

borkdude07:12:24

The ClassCastException may not be available in bb which is why you would get nil

borkdude09:12:38

I'll add it

borkdude10:12:09

$ bb '(shell/with-sh-env {:FOO "BAR"} (shell/sh "bash" "-c" "echo $FOO"))'
{:exit 0, :out "BAR\n", :err ""}

borkdude20:12:38

$ BABASHKA_CLASSPATH=. bb --repl
Babashka v0.0.56-SNAPSHOT REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (io/resource "deps.edn")
#object[.URL 0x61932785 "file:/Users/borkdude/Dropbox/dev/clojure/carve/deps.edn"]

borkdude20:12:08

The order of the arguments is indicated by:

Usage: bb [ -i | -I ] [ -o | -O ] [ --stream ] [--verbose]
          [ ( --classpath | -cp ) <cp> ] [ ( --main | -m ) <main-namespace> ]
          ( -e <expression> | -f <file> | --repl | --socket-repl [<host>:]<port> )
          [ --uberscript <file> ] [ arg* ]

borkdude11:12:18

I don't want to be dependent on the rules of a tool for parsing options

jeroenvandijk11:12:48

Thanks. Yes can imagine. Although tools.cli is somewhat low level and without side effects, it still has made some decisions for you

borkdude20:12:44

you'll probably need to use export when you're running another script

borkdude21:12:27

Made a thing to cut out the unused vars from a project: https://github.com/borkdude/carve Unleashing this on a script produced with --uberscript will make it even smaller.

borkdude21:12:54

(btw @lee it uses rewrite-cljc)

lread22:12:08

Coolio @borkdude! Has anybody ever mentioned you are whirlwind of productivity? I’ll be back to coding in the new year and drag rewrite-cljc through to an official release.

borkdude22:12:10

ok, let me know if you will remove the repo, so I can update my url/sha

borkdude22:12:19

but so far, it seems to work perfectly