2024-08-23 16:14:46 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
MODE=$1 # Either "dirs" or "files", depending on the type of input
|
|
|
|
shift
|
|
|
|
SCRIPT=$1
|
|
|
|
shift
|
|
|
|
TYPE=""
|
|
|
|
if [ $1 = "-t" ]
|
|
|
|
then
|
|
|
|
TYPE=$2 # Used if softenv analysis
|
|
|
|
shift
|
2024-08-26 14:40:43 +02:00
|
|
|
OUTPUT=$2
|
|
|
|
shift
|
2024-08-23 16:14:46 +02:00
|
|
|
else
|
|
|
|
OUTPUT=$1
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
INPUT="$@"
|
|
|
|
|
|
|
|
# Adding option prefix:
|
2024-08-26 14:40:43 +02:00
|
|
|
if [ "$TYPE" != "" ]
|
2024-08-23 16:14:46 +02:00
|
|
|
then
|
|
|
|
TYPE="-t $TYPE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If inputs are files, then we just use that as input for the script:
|
|
|
|
INPUT_FILES=$INPUT
|
|
|
|
# If inputs are directories, we need to explore every single one of them
|
|
|
|
# to find the input files to pass to the script:
|
|
|
|
if [ $MODE = "dirs" ]
|
|
|
|
then
|
|
|
|
INPUT_FILES=""
|
|
|
|
for dir in $INPUT
|
|
|
|
do
|
|
|
|
INPUT_FILES="$INPUT_FILES $(find $dir/*.csv -maxdepth 1 -type f)"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
python3 $SCRIPT $TYPE -i $INPUT_FILES -o $OUTPUT
|