Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Conversation

@sixcy
Copy link

@sixcy sixcy commented May 9, 2021

Hello,

For my personal needs I implemented a new feature: !(EXEC cmd) to execute a command (with shell) and replace the syntax by its result.

This can be useful for automating the generation of a Markdown file, for instance inserting the current date (or, say, a version number):

Project version: !{EXEC bash -c "./get_version.sh"}
Date of today: !(EXEC date)

It is also possible to escape it; that's how the readme.mdpp is able to process correctly
\!(EXEC This will not execute)

If there are parenthesis/braces/brackets in the EXEC command, right now it will pose issues because I implemented it using a simple regexp (one would require a grammar to take care of matching parenthesis).

The workaround is to use different delimiters ; there are three available, parenthesis, brackets and braces
\![EXEC echo "A command with different delimitors"]

By using the PR #79 I was able to pass all tests, except one (exec_file) which required to correct a minor bug (see commit 23c23f1)

I'm open to any change

Cyril SIX added 7 commits May 9, 2021 17:04
This was causing issues when running multiple tests, in particular for
the modules member: modules were executing much more than once, because
each additional test would add duplicates to the list which wasn't
reinitialized

In particular this was causing issues with my new Exec module getting
ran more than once per data.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant