diff --git a/op-bindings/gen_bindings.sh b/op-bindings/gen_bindings.sh index a094c56e9cf97..c0da46e6540d5 100755 --- a/op-bindings/gen_bindings.sh +++ b/op-bindings/gen_bindings.sh @@ -9,6 +9,16 @@ if [ "$#" -ne 2 ]; then exit 1 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 PACKAGE=$2 diff --git a/op-bindings/gen_deployed_bytecode.sh b/op-bindings/gen_deployed_bytecode.sh index 3a6fa152b4033..9cb0e8af10564 100755 --- a/op-bindings/gen_deployed_bytecode.sh +++ b/op-bindings/gen_deployed_bytecode.sh @@ -7,6 +7,15 @@ if [ "$#" -ne 2 ]; then exit 1 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 PACKAGE=$2