Closed abitrolly closed 4 months ago
Hey @abitrolly! I'm here to help you with any issues or questions you have. I can assist with bug fixes, answer your queries, and guide you on becoming a contributor. Let me know how I can assist you!
I couldn't find any information about the markdown blocks execution engine in the repository. It seems there are no references to it in the documentation, commit messages, or issue tracker .
To continue talking to Dosu, mention @dosu.
Are you looking for xcfile.dev
?
@jhheider thanks, but it looks like it is meant to run tasks, and doesn't update the output in markdown files (need deeper checks). I remember this repo used to run the script that updated and/or validated command output.
Hm, I'm not sure what that would be. We have task runners like xc and just and, of course, make, packages. And stuff link amber-lang, shellcheck and other tools to make scripting reliable. But I don't specifically know of a tool for updating and validating scripts. pier
might be the closest, but I don't think it's what you're looking for.
I knew it, but lost. I think it was used for unit testing or something. Got this so far.
Where is this pier
?
Yea, organizing shell snippets is a bit different task.
Found something extracted from Go internals https://github.com/rogpeppe/go-internal/tree/master/cmd/testscript
Found two other project that execute test files combining commands with expected output.
I packed testscript
for Homebrew. Now I need to see what it takes for pkgx
to run it.
very little; i should be able to do it today.
test:
- run: test "$(testscript $FIXTURE)" = "PASS"
fixture:
extname: txtar
contents: |
exec echo hello!
stdout hello!
Maybe pkgx
should adopt txtar
format too. :D
testscript: |
exec testscript hello.txtar
stdout PASS
-- hello.txtar --
exec echo hello!
stdout hello!
there's an even simpler solution:
interprets:
extensions: txtar
args: testscript
test:
dependencies:
pkgx.sh: 1
script:
- run: test "$(pkgx $FIXTURE)" = "PASS"
fixture:
extname: txtar
contents: |
exec echo hello!
stdout hello!
there's an even simpler solution:
Not sure why. The code got some additional lines, and it is not clear what they do.
because now pkgx
can execute txtar
scripts directly. That's what the interprets:
block enables.
I remember there was a piece of code that executed and probably updated markdown blocks. Is it still available somewhere? Would like to reuse it for some troubleshooting. Tired of pasting code blocks in dead documents that need to be updated when new versions of tools inside released.