Closed sisp closed 1 year ago
By all means go ahead :) I don't have the time to do this myself, but am happy to help on our side where needed. You might struggle with the syntax tree types, since those are trees of pointers which make use of interfaces to mimic sum types. That's ultimately why I wrote https://pkg.go.dev/mvdan.cc/sh/v3/syntax/typedjson - not just for shfmt --to-json
, but also for interfacing with languages like JS so that the syntax tree can be encoded to bytes.
I'm going to close this as there isn't anything actionable to do here. As said above, I'm happy to support the effort to do bindings, but I don't have the time to do them myself, so they won't be in this repository.
I've stumbled over this project because Task uses it:
We have a similar use case in Copier where cross-platform shell commands may be declare by template creators through the tasks feature. Copier is written in Python though, so I've been wondering whether you might be open to providing Python bindings to
sh
since there already exists a JS package (through transpilation though). It seems possible to create Python bindings for Go libraries usinggopy
. I'd be happy to look into it if you agree on the general idea. :slightly_smiling_face: