BioLockJ-Dev-Team / sheepdog_testing_suite

Test suite for BioLockJ development team.
3 stars 8 forks source link

shorts: add a mechanism to include very short files in the config file #324

Open IvoryC opened 3 years ago

IvoryC commented 3 years ago

Add a mechanism to include very short files in the config file. Many genmod scripts are very short, and it would be easier to read the whole project config if the code was in the config file.

Consider this format: config file:

BioModule biolockj.module.diy.ForEachFile AS Truncate

Truncate.scriptPath=${myScript.sh} Truncate.dockerImage=ubuntu

>>myScript.sh

> full=$(wc -l $1)

> echo "File $1 has $full lines...truncating to 50..."

> OUTFILE="$(dirname $PWD)/output/$1"

> head -n 50 $1 > $OUTFILE

> echo "Done!"

><

pipeline.defaultProps=/path/to/file ...

back-end: A "short" is a short text file that is written in the config file. When BioLockJ finds a line that starts with "#>>" it recognizes that as the start of a short, and assumes the rest of that line is the file name. Each following line that starts with "#>" is taken as a line of the file. When it reaches a line that starts with "#><" that is the end of the file. Early on, BioLockJ scans the config file for this embedded files, and saves them to a temp directory... or maybe $PIPE/resources/shorts/. And it saves a local property with name matching that file name, as if the config file had had "myScript.sh=$PIPE/resources/shorts/myScript.sh". When it process variable values, it will interpret $myScript.sh as a file in the tmp dir.