1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00

make script/generate-example more resilient around missing files

This commit is contained in:
Charlie Somerville 2018-04-11 15:49:57 +10:00
parent 2cb4726f50
commit 63a10f210b

View File

@ -35,17 +35,23 @@ generate_example () {
diffFileAB="${fileA%%.*}.diffA-B.txt"
diffFileBA="${fileB%%.*}.diffB-A.txt"
if [ -e "$fileA" ]; then
status $parseFileA
"$(dirname "$0")/run" semantic parse --sexpression $fileA > $parseFileA
fi
if [ -e "$fileB" ]; then
status $parseFileB
"$(dirname "$0")/run" semantic parse --sexpression $fileB > $parseFileB
fi
if [ -e "$fileA" -a -e "$fileB" ]; then
status $diffFileAB
"$(dirname "$0")/run" semantic diff --sexpression $fileA $fileB > $diffFileAB
status $diffFileBA
"$(dirname "$0")/run" semantic diff --sexpression $fileB $fileA > $diffFileBA
fi
}
if [[ -d $1 ]]; then