Fork me on GitHub
#babashka
<
2023-05-25
>
leifericf12:05:01

I'm currently writing some Babashka scripts to interact with Microsoft Azure and GitHub, essentially "wrapping" series of https://learn.microsoft.com/en-us/cli/azure/, https://learn.microsoft.com/en-us/cli/azure/azure-cli-reference-for-devops, and https://cli.github.com/ commands. My plan is to distribute these scripts to my teammates. Developers must have Azure's and GitHub's CLI tools installed on their machine to use execute the shell commands that I'm using within my Babashka scripts, and the installation procedures differ depending on the developer's operating system. We have developers using Windows, Linux, and macOS. Does there exist some kind of mechanism or "best practice" for "bundling" or ensuring that Azure's and GitHub's CLI tools are installed, and install them automatically if necessary? Effectively having my Babashka scripts install their own external dependencies.

nenadalm13:05:13

for macos and linux you could use homebrew which allows specifying other scripts as dependencies: https://docs.brew.sh/Formula-Cookbook#specifying-other-formulae-as-dependencies

leifericf13:05:51

Oh, cool! I'm an avid user of Homebrew for macOS, but I didn't know it also existed for Linux.

2
escherize14:05:20

Is there a way to get https://github.com/lambdaisland/hiccup running on babashka? Maybe need to include some more java xml namespaces? I am switching to https://github.com/weavejester/hiccup but it’d be nice. Stacktrace in 🧵

escherize14:05:35

----- Error --------------------------------------------------------------------
Type:     java.lang.Exception
Message:  Unable to resolve classname: org.xml.sax.ContentHandler
Location: net/cgrand/xml.clj:11:3

----- Context ------------------------------------------------------------------
 7: ;   You must not remove this notice, or any other, from this software.
 8:
 9: (ns net.cgrand.xml
10:   (:require [clojure.zip :as z])
11:   (:import (org.xml.sax ContentHandler Attributes SAXException XMLReader)
      ^--- Unable to resolve classname: org.xml.sax.ContentHandler
12:            (org.xml.sax.ext DefaultHandler2)
13:            (javax.xml.parsers SAXParser SAXParserFactory)))
14:
15: (defstruct element :tag :attrs :content)
16:

----- Stack trace --------------------------------------------------------------
net.cgrand.xml                            - net/cgrand/xml.clj:11:3
net.cgrand.tagsoup                        - net/cgrand/tagsoup.clj:12:3
net.cgrand.enlive-html                    - net/cgrand/enlive_html.clj:14:3
lambdaisland.hiccup                       - lambdaisland/hiccup.clj:7:3

borkdude14:05:32

it seems this project depends on clj-tagsoup which in turn depends on tagsoup which is written in Java, so it won't work in bb

gratitude-thank-you 2
💡 2
escherize14:05:30

Thanks for looking into it