Commit f7fe194f authored by Joshua Gutow's avatar Joshua Gutow Committed by GitHub

bindings: Notify users if builds deps are not found (#2599)

This specifically notifies users if abigen, forge, and gofmt are
not found in the path. This is to provide an early warning that
the commands are required instead of failing when attempting to
invoke the commands.
parent edb80024
...@@ -9,6 +9,16 @@ if [ "$#" -ne 2 ]; then ...@@ -9,6 +9,16 @@ if [ "$#" -ne 2 ]; then
exit 1 exit 1
fi fi
need_cmd() {
if ! command -v "$1" > /dev/null 2>&1; then
echo "need '$1' (command not found)"
exit 1
fi
}
need_cmd forge
need_cmd abigen
TYPE=$1 TYPE=$1
PACKAGE=$2 PACKAGE=$2
......
...@@ -7,6 +7,15 @@ if [ "$#" -ne 2 ]; then ...@@ -7,6 +7,15 @@ if [ "$#" -ne 2 ]; then
exit 1 exit 1
fi fi
need_cmd() {
if ! command -v "$1" > /dev/null 2>&1; then
echo "need '$1' (command not found)"
exit 1
fi
}
need_cmd gofmt
TYPE=$1 TYPE=$1
PACKAGE=$2 PACKAGE=$2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment