-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: register-public-key & CLI update to use options instead of args #1397
Changes from 1 commit
bf58b52
f1a2204
40fbd2b
7d44401
5447939
09bf18c
5847d89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,14 +22,27 @@ ROOT=$(pwd) | |
|
||
write_import() { | ||
CONTRACT_NAME=$1 | ||
NAME=`echo $CONTRACT_NAME | sed -r 's/(^|_)(.)/\U\2/g'` | ||
|
||
if [ "$(uname)" = "Darwin" ]; then | ||
# sed \U doesn't work on mac | ||
NAME=$(echo $CONTRACT_NAME | perl -pe 's/(^|_)(\w)/\U$2/g') | ||
else | ||
NAME=`echo $CONTRACT_NAME | sed -r 's/(^|_)(.)/\U\2/g'` | ||
fi | ||
|
||
echo "import ${NAME}Json from './${CONTRACT_NAME}_contract.json' assert { type: 'json' };" >> "$artifacts_dir/index.ts"; | ||
} | ||
|
||
write_export() { | ||
CONTRACT_NAME=$1 | ||
NAME=`echo $CONTRACT_NAME | sed -r 's/(^|_)(.)/\U\2/g'` | ||
|
||
if [ "$(uname)" = "Darwin" ]; then | ||
# sed \U doesn't work on mac | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't we just always use perl for simplicity? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep don't know why I didn't think of that 😬 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not supported in CI :( |
||
NAME=$(echo $CONTRACT_NAME | perl -pe 's/(^|_)(\w)/\U$2/g') | ||
else | ||
NAME=`echo $CONTRACT_NAME | sed -r 's/(^|_)(.)/\U\2/g'` | ||
fi | ||
|
||
|
||
# artifacts | ||
echo "export const ${NAME}ContractAbi = ${NAME}Json as ContractAbi;" >> "$artifacts_dir/index.ts"; | ||
echo "Written typescript for $NAME" | ||
|
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.
nicely done