novoid / appendfilename

Intelligent appending text to file names, considering file extensions and file tags
GNU General Public License v3.0
50 stars 7 forks source link

extend tester's pattern to all five provided by date2name #14

Closed nbehrnd closed 2 years ago

novoid commented 2 years ago

Just a remark: you could check any available tool in $PATH via $(which toolname) and decide in an if statement which one to choose by pointing it to a wrapper variable.

Something according to that: (untested!)

PYTEST=$(which pytest)
PYTEST3=$(which pytest-3)
if [ ! -z ${PYTEST} ]; then
    TESTTOOL= ${PYTEST}
elif [ ! -z ${PYTEST3} ]; then
    TESTTOOL= ${PYTEST3}
else
   # print error message -> no pytest found at all
fi
[...]
${TESTTOOL} ...  ## using pytest only via that wrapper variable