mirror of
https://github.com/xlucn/PAT.git
synced 2026-10-07 10:52:46 +08:00
18 lines
465 B
Python
18 lines
465 B
Python
#!/bin/sh
|
|
master=$(git ls-tree -r --name-only master PAT*/)
|
|
markdown=$1
|
|
id=$(basename "${markdown%.md}")
|
|
index=${id#[a-z]}
|
|
c=${id%%[0-9]*}
|
|
case $c in
|
|
'a') codefile=PATAdvanced/$index.c ;;
|
|
'b') codefile=PATBasic/$index.c ;;
|
|
't') codefile=PATTop/$index.c ;;
|
|
*) echo "file name wrong: $markdown"; exit ;;
|
|
esac
|
|
if [ "$master" != "${master%$codefile*}" ]; then
|
|
python "$(dirname "$0")/build.py" -o "$id"
|
|
else
|
|
echo "$codefile does not exist"
|
|
fi
|