mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +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:
commit
d45fafd5e2
@ -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"
|
||||||
|
|
||||||
|
if [ -e "$fileA" ]; then
|
||||||
status $parseFileA
|
status $parseFileA
|
||||||
"$(dirname "$0")/run" semantic parse --sexpression $fileA > $parseFileA
|
"$(dirname "$0")/run" semantic parse --sexpression $fileA > $parseFileA
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "$fileB" ]; then
|
||||||
status $parseFileB
|
status $parseFileB
|
||||||
"$(dirname "$0")/run" semantic parse --sexpression $fileB > $parseFileB
|
"$(dirname "$0")/run" semantic parse --sexpression $fileB > $parseFileB
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "$fileA" -a -e "$fileB" ]; then
|
||||||
status $diffFileAB
|
status $diffFileAB
|
||||||
"$(dirname "$0")/run" semantic diff --sexpression $fileA $fileB > $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
|
||||||
|
Loading…
Reference in New Issue
Block a user