Having a good time now - this is probably the first time I've actually gotten value out of Clojure at work in ten years of wishing :P
Silly convenience wrappers:
>cat~/bin/jokes/lib/shell.joke#!/usr/bin/env/usr/local/bin/joker(nslib.shell(:require[joker.os:refer[execsh]]))(defnsh-v"Verbosely execute a script via joker.os/sh."[bin&args](applyprintln"Executing:\t"binargs)(applyshbinargs)(println"Complete."))(defnexec-v"Verbosely execute a script via joker.os/exec."[binargs](let[opts{:argsargs:stdin*in*:stdout*out*:err*err*}](applyprintln"Executing:\t"binargs)(let[result(execbinopts)](printlnresult)(println"Complete."))))
Usage:
>catwtf-docker#!/usr/bin/env/usr/local/bin/joker(nsscript(:require[lib.cli:refer[argv-str]][lib.shell:asshell]))(defndocker-shell"Open a bash shell inside the supplied docker tag or hash."[tag-or-hash](let[sh-args["run""-ti"tag-or-hash"/bin/bash""--login"]](shell/exec-v"docker"sh-args)))(defresults(docker-shellargv-str))(printlnresults)
Most of my Joker code is internal, but here's something I've put together for my own purposes.
github.com/hlship/dialog-tool
It's pretty much the kind of brutal, pragmatic kind of code you'd put in a Bash script, but in Joker, and it runs fast and nice.
Appreciate it, thank you.
Having a good time now - this is probably the first time I've actually gotten value out of Clojure at work in ten years of wishing :P
Silly convenience wrappers:
Usage:
Demo: