Skip to content

Commit

Permalink
fix: sh functions do not use function prefix on Linux
Browse files Browse the repository at this point in the history
Seems like the behavior in `sh` is not aligned between OSX and Linux.
On Linux, sh script functions are not supposed to be prefixed with the
`function` keyword.
  • Loading branch information
Rqnsom committed Jul 8, 2024
1 parent 89fe302 commit 6365f87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pallet/src/assets/move-projects/gas-costs-bundles/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ cd $(dirname $0)

ITERATIONS=25

function write_module() {
write_module() {
printf "module AiBob::CalMod$2 {\n" >> $1
printf " fun fun_fun(a: u8) {\n" >> $1
printf " assert!(a == 0, 0);\n" >> $1
printf " }\n" >> $1
printf "}\n" >> $1
}

function create_move_project() {
create_move_project() {
NAME=bundle$1
smove new $NAME
TOML=$NAME/Move.toml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ITERATIONS=25
ALICE=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
BOB=5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty

function write_smove_cmd() {
write_smove_cmd() {
cp build/gas-costs/bytecode_scripts/mint.mv build/gas-costs/bytecode_scripts/mint_$1.mv
printf "\nsmove create-transaction -c build/gas-costs/bytecode_scripts/mint_$1.mv --args signer:$BOB address:$ALICE u64:$1" >> $BASH_SH
}
Expand Down

0 comments on commit 6365f87

Please sign in to comment.