2017-04-05 23:17:03 +03:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Run scripts with hg-dev environment. Examples:
|
|
|
|
#
|
|
|
|
# with-hg-dev ./lint.py
|
|
|
|
# with-hg-dev ./unit.py
|
|
|
|
#
|
|
|
|
# Exit 40 if hg-dev cannot be found, or does not have desired effect.
|
|
|
|
|
|
|
|
SCRIPT_PATH="${BASH_SOURCE[0]:-$0}"
|
|
|
|
builtin cd $(dirname "$SCRIPT_PATH")
|
|
|
|
|
|
|
|
if [[ -z $HG_DEV_DIR ]]; then
|
2018-03-02 02:00:58 +03:00
|
|
|
for path in ../../hg-dev ${HG_RPM_DIR}; do
|
2017-04-05 23:17:03 +03:00
|
|
|
if [[ -f "$path" ]]; then
|
|
|
|
source "$path"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [[ -z $HG_DEV_DIR ]]; then
|
|
|
|
echo abort: cannot find hg-dev 1>&2
|
|
|
|
exit 40
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-03-02 02:00:58 +03:00
|
|
|
command "$@"
|