diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-05-08 10:37:33 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-05-08 11:01:18 +0300 |
commit | 91cff65b5a5421ce6011909fe61df45dea1c99fd (patch) | |
tree | d0e26f10f3022751494f71f31742436ce23567f0 /templates | |
parent | bad0209b1a9df569fddb99b22aae631860e32067 (diff) | |
download | subplot-91cff65b5a5421ce6011909fe61df45dea1c99fd.tar.gz |
Change: bash template to run only requested scenarios
Diffstat (limited to 'templates')
-rw-r--r-- | templates/bash/template.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/templates/bash/template.sh b/templates/bash/template.sh index 2466b69..c0a6e7e 100644 --- a/templates/bash/template.sh +++ b/templates/bash/template.sh @@ -195,9 +195,23 @@ scenario_{{ loop.index }}() { ############################################################################# # Run the scenarios. +if [ "$#" = 0 ] +then {% for scenario in scenarios %} + scenario_{{ loop.index }}{% endfor %} +else + + + for pattern in "$@" + do + pattern="$(echo "$pattern" | tr A-Z a-z)" {% for scenario in scenarios %} -scenario_{{ loop.index }} + if echo "{{ scenario.title | lower }}" | grep -F -e "$pattern" > /dev/null + then + scenario_{{ loop.index }} + fi {% endfor %} + done +fi ############################################################################# |