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

15 lines
378 B
Bash
Raw Normal View History

2023-02-26 14:39:55 +00:00
#!/usr/bin/env bash
scriptDir=$( dirname -- "$0"; )
cd "$scriptDir/.." || exit
for match in $(grep -e '\[Generate\]' -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