This repository was archived by the owner on Sep 2, 2021. It is now read-only.
Executing a command and retrieving its result with !(EXEC cmd) syntax#80
Open
sixcy wants to merge 7 commits intoamyreese:masterfrom
Open
Executing a command and retrieving its result with !(EXEC cmd) syntax#80sixcy wants to merge 7 commits intoamyreese:masterfrom
sixcy wants to merge 7 commits intoamyreese:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdppis 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