2023-02-26 14:39:55 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
|
|
scriptDir=$( dirname -- "$0"; )
|
|
|
|
cd "$scriptDir/.." || exit
|
|
|
|
|
2023-02-26 18:19:16 +00:00
|
|
|
for match in $(grep -e '\[Sum\]\|\[Equal\]\|\[Mean\]' -o *.cs | tr -d '[]')
|
2023-02-26 14:39:55 +00:00
|
|
|
do
|
2023-02-26 18:19:16 +00:00
|
|
|
path="${match%:*}"
|
|
|
|
type="${match#*:}"
|
|
|
|
file=$(basename -- "$path")
|
|
|
|
class="${file%.*}"
|
|
|
|
echo "generating $file"
|
2023-03-02 16:15:10 +00:00
|
|
|
sed "s/Template/$class/g; s/AggregationType/$type/g" "./Generator/Template.txt" > "./$class.generated.cs"
|
2023-02-26 14:39:55 +00:00
|
|
|
done
|