Innovenergy_trunk/csharp/Lib/Units/Generator/generate.sh

15 lines
394 B
Bash
Raw Normal View History

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"
sed "s/Template/$class/g; s/AggregationType/$type/g" "./Generator/Template.txt" > "./$class.generated.cs"
2023-02-26 14:39:55 +00:00
done