-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from axelarnetwork/feat/evm-codegen-bin
feat: @axelarjs/evm cli
- Loading branch information
Showing
4 changed files
with
265 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@axelarjs/evm": patch | ||
--- | ||
|
||
feat: introduce @axelarjs/evm cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
# commands: | ||
# codegen: generate code from abi | ||
|
||
COMMAND=$1 | ||
|
||
# comma separated list of valid commands | ||
VALID_COMMANDS="codegen" | ||
|
||
get_npx_compatible_command(){ | ||
# check if npx is installed | ||
if command -v npx &> /dev/null | ||
then | ||
echo "npx" | ||
# check if pnpx is installed | ||
elif command -v pnpx &> /dev/null | ||
then | ||
echo "pnpx" | ||
# check if bunx is installed | ||
elif command -v bunx &> /dev/null | ||
then | ||
echo "bunx" | ||
else | ||
echo "npx, pnpx or bunx is required to run this script" | ||
exit 1 | ||
fi | ||
} | ||
|
||
|
||
# get the npx compatible command | ||
NPX_COMMAND=$(get_npx_compatible_command) | ||
|
||
case $COMMAND in | ||
codegen) | ||
echo "using '$NPX_COMMAND' to run codegen" | ||
$NPX_COMMAND tsx ./scripts/codegen.ts "$@" | ||
;; | ||
*) | ||
echo "unknown command received: '$COMMAND'" | ||
echo "valid commands:" | ||
# split string into array and print each element on a new line with a - prefix | ||
echo "$VALID_COMMANDS" | tr ',' '\n' | sed 's/^/ * /' | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
e1468c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
axelar-registry – ./apps/registry
axelar-registry-axelar-network.vercel.app
axelar-registry-git-main-axelar-network.vercel.app
e1468c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
axelar-ui – ./packages/ui
axelar-ui-axelar-network.vercel.app
axelar-ui-git-main-axelar-network.vercel.app
axelar-ui.vercel.app
ui.axelar.dev