Skip to content

Commit f7fe194

Browse files
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.
1 parent edb8002 commit f7fe194

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

op-bindings/gen_bindings.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ if [ "$#" -ne 2 ]; then
99
exit 1
1010
fi
1111

12+
need_cmd() {
13+
if ! command -v "$1" > /dev/null 2>&1; then
14+
echo "need '$1' (command not found)"
15+
exit 1
16+
fi
17+
}
18+
19+
need_cmd forge
20+
need_cmd abigen
21+
1222

1323
TYPE=$1
1424
PACKAGE=$2

op-bindings/gen_deployed_bytecode.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ if [ "$#" -ne 2 ]; then
77
exit 1
88
fi
99

10+
need_cmd() {
11+
if ! command -v "$1" > /dev/null 2>&1; then
12+
echo "need '$1' (command not found)"
13+
exit 1
14+
fi
15+
}
16+
17+
need_cmd gofmt
18+
1019

1120
TYPE=$1
1221
PACKAGE=$2

0 commit comments

Comments
 (0)