Skip to content

Commit 8452bd4

Browse files
allow for --local and --no-build for release.sh script
1 parent e3ceb05 commit 8452bd4

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

release.sh

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
#!/usr/bin/env bash
22

3-
# Exit script as soon as a command fails.
4-
set -o errexit
3+
POSITIONAL_ARGS=()
4+
5+
while [[ $# -gt 0 ]]; do
6+
case $1 in
7+
--local)
8+
local=1
9+
shift # past argument
10+
;;
11+
--no-build)
12+
skip_build=1
13+
shift # past argument
14+
;;
15+
-*|--*)
16+
echo "Unknown option $1"
17+
exit 1
18+
;;
19+
*)
20+
POSITIONAL_ARGS+=("$1") # save positional arg
21+
shift # past argument
22+
;;
23+
esac
24+
done
25+
26+
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
527

628
echo "### Release script started..."
29+
if [[ $skip_build -eq 0 ]]; then
730
yarn build
31+
fi
832
echo "### Build finished. Copying abis."
933
rm -rf contracts/abi
1034
mkdir -p contracts/abi
@@ -18,7 +42,11 @@ cp README.md contracts/README.md
1842
# publish from contracts folder
1943
cd contracts
2044
echo "### Publishing..."
45+
if [[ $local -eq 1 ]]; then
46+
yalc push
47+
else
2148
np --any-branch --no-tests
49+
fi
2250
# delete copied README
2351
rm README.md
2452
# back to root folder

0 commit comments

Comments
 (0)