ECC-673: bufr_filter: cope with emoslib and bufrdc having different executable names

This commit is contained in:
Shahram Najm 2019-09-23 11:31:52 +01:00
parent a7452b5da4
commit 35bd4eea43
1 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,8 @@
#!/bin/sh
set -u
script_dir=`dirname $0`
EMOSLIB_TOOL=bufrdc_emoslib_bufr_filter
BUFRDC_TOOL=bufrdc_emoslib_bufr_filter
EMOSLIB_TOOL=emoslib_bufr_filter
ECCODES_TOOL=codes_bufr_filter
result=0 # return code from function
ERR_TOOL_NOT_FOUND=666
@ -37,7 +38,7 @@ if [ $# -eq 0 ]; then
the_tool=$ECCODES_TOOL
try_tool "${@}"
if [ $result -eq $ERR_TOOL_NOT_FOUND ]; then
the_tool=$EMOSLIB_TOOL
the_tool=$BUFRDC_TOOL
try_tool "${@}"
fi
exit 0
@ -53,6 +54,10 @@ if [ $is_emoslib -eq 1 ]; then
pkg='emoslib/bufrdc'
the_tool=$EMOSLIB_TOOL
try_tool "${@}"
if [ $result -eq $ERR_TOOL_NOT_FOUND ]; then
the_tool=$BUFRDC_TOOL
try_tool "${@}"
fi
else
pkg='ecCodes'
the_tool=$ECCODES_TOOL