2018-02-26 10:12:27 +11:00
|
|
|
#!/usr/bin/env bash
|
2016-12-10 10:57:01 -08:00
|
|
|
# TODO: Find a less trashy way to get the next available error code
|
2018-02-26 10:11:44 +11:00
|
|
|
if ! shopt -s globstar
|
|
|
|
|
then
|
|
|
|
|
echo "Error: This script depends on Bash 4." >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2016-12-10 10:57:01 -08:00
|
|
|
|
2020-09-01 16:48:14 -07:00
|
|
|
for i in 1 2 3
|
2016-12-10 10:57:01 -08:00
|
|
|
do
|
2020-04-01 09:03:38 +02:00
|
|
|
last=$(grep -hv "^prop" ./**/*.hs | grep -Ewo "${i}[0-9]{3}" | sort -n | tail -n 1)
|
2016-12-10 10:57:01 -08:00
|
|
|
echo "Next ${i}xxx: $((last+1))"
|
|
|
|
|
done
|