1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Merge pull request #1736 from github/charliesome/fix-generate-example

Make script/generate-example more resilient around missing files
This commit is contained in:
Charlie Somerville 2018-04-12 11:42:01 +10:00 committed by GitHub
commit d45fafd5e2

View File

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