Fork me on GitHub
#babashka-sci-dev
<
2022-02-04
>
lispyclouds12:02:49

Would the ability to tar and untar be a useful addition to the bb stdlib? I find myself needing to do a lot of (un)tarring myself when using bb in various infrastructure automation scenarios. Things like python and golang have tar inbuilt. I have to make sure tar is installed with bb and shell out.

lispyclouds12:02:52

Feels like going in the "batteries-included" spirit 😄

lispyclouds12:02:34

or maybe in babashka.fs? :thinking_face:

borkdude12:02:05

@rahul080327 does Java provide a tar implementation? I think not. But tar is available on every major OS, so I think shelling out is pretty safe to do

lispyclouds12:02:37

yeah i dont think java does yet, hence my doubts of adding it too

borkdude12:02:11

I don't like pulling in another dependency but we could write a namespace or some functions around shelling out to it

lispyclouds12:02:18

yeah thats how i have been doing it so far and something like https://github.com/kamranzafar/jtar which i guess is the most used one is quite a heavy addition

lispyclouds12:02:37

i get stuck in alpine images mainly

borkdude12:02:32

I don't understand you're stuck if you can shell out to tar? Or is tar not there in alpine by default?

lispyclouds12:02:51

yeah alpine doesnt include tar i think

borkdude12:02:38

then maybe install it?

lispyclouds12:02:27

yeah that how im doing it now. yeah not worth too much to have in bb

borkdude12:02:33

I still have to add zip to babashka.fs hammock

lispyclouds12:02:27

well as long as there is java stdlib support, it can be considered. thats the biggest hurdle in tar

borkdude12:02:46

like babashka.curl we could have a small ns around it but I'm not sure if it adds much value compared to shelling out

borkdude12:02:16

and tar is even by default available on Windows now

lispyclouds12:02:24

yeah not worth it til jdk has it i guess.

borkdude12:02:38

I wonder if jdk will ever have a built-in json library

1