Skip to content

Commit ac30887

Browse files
committed
Add support for building multiple contracts at once
1 parent 5005406 commit ac30887

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

optimize.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ command -v shellcheck > /dev/null && shellcheck "$0"
55
export PATH=$PATH:/root/.cargo/bin
66

77
mkdir -p artifacts
8-
contractdir="$1"
8+
contractdirs="$@"
99

1010
# There are two cases here
1111
# 1. All contracts (or one) are included in the root workspace (eg. `cosmwasm-template`, `cosmwasm-examples`, `cosmwasm-plus`)
1212
# In this case, we pass no argument, just mount the proper directory.
13-
# 2. Contacts are excluded from the root workspace, but import relative paths from other packages (only `cosmwasm`).
13+
# 2. Contracts are excluded from the root workspace, but import relative paths from other packages (only `cosmwasm`).
1414
# In this case, we mount root workspace and pass in a path `docker run <repo> ./contracts/hackatom`
1515

1616
# This parameter allows us to mount a folder into docker container's "/code"
1717
# and build "/code/contracts/mycontract".
1818
# Note: if contractdir is "." (default in Docker), this ends up as a noop
19+
for contractdir in $contractdirs
20+
do
1921
echo "Building contract in $(realpath -m "$contractdir")"
2022
(
2123
cd "$contractdir"
@@ -39,3 +41,4 @@ done
3941
)
4042

4143
echo "done"
44+
done

0 commit comments

Comments
 (0)