Skip to content

Commit d8b3f22

Browse files
author
Arn0d
authored
fix bug script for linux (#312)
1 parent 20c2f85 commit d8b3f22

4 files changed

Lines changed: 15 additions & 14 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ build
2727

2828
tmp
2929
.tmp*
30-
scripts/*.log
30+
scripts/*.log
31+
scripts/*/*.log

scripts/deploy_minter.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ declare() {
4747

4848
# Check if ggrep is available
4949
if command -v ggrep >/dev/null 2>&1; then
50-
address=$(echo -e "$output" | ggrep -oP '0x[0-9a-fA-F]+')
50+
address=$(echo -e "$output" | ggrep -oP '0x[0-9a-fA-F]+' | tail -n 1)
5151
else
5252
# If ggrep is not available, use grep
53-
address=$(echo -e "$output" | grep -oP '0x[0-9a-fA-F]\+')
53+
address=$(echo -e "$output" | grep -oP '0x[0-9a-fA-F]+' | tail -n 1)
5454
fi
5555
echo $address
5656
}
@@ -67,11 +67,11 @@ declare() {
6767
# $9 - Reserved Value
6868
# $10 - Owner
6969
deploy() {
70-
class_hash=$(declare | tail -n 1)
71-
sleep 5
70+
class_hash=$(declare)
71+
sleep 5
7272

73-
if [[ $debug == "true" ]]; then
74-
printf "deploy %s %s %s %s %s %s %s %s %s %s \n" "$class_hash" "$PROJECT" "$SLOT" "$ERC20" "$PUBLIC_SALE_OPEN" "$MIN_VALUE_PER_TX" "$MAX_VALUE_PER_TX" "$MAX_VALUE" "$UNIT_PRICE" "$RESERVED_VALUE" >> debug_minter.log
73+
if [[ $debug == "true" ]]; then
74+
printf "deploy %s %s %s %s %s %s %s %s %s %s %s \n" "$class_hash" "$PROJECT" "$SLOT" "$ERC20" "$PUBLIC_SALE_OPEN" "$MIN_VALUE_PER_TX" "$MAX_VALUE_PER_TX" "$MAX_VALUE" "$UNIT_PRICE" "$RESERVED_VALUE" "$OWNER" >> debug_minter.log
7575
fi
7676
output=$(starkli deploy $class_hash "$PROJECT" u256:"$SLOT" "$ERC20" "$PUBLIC_SALE_OPEN" u256:"$MAX_VALUE_PER_TX" u256:"$MIN_VALUE_PER_TX" u256:"$MAX_VALUE" u256:"$UNIT_PRICE" u256:"$RESERVED_VALUE" "$OWNER" --keystore-password $KEYSTORE_PASSWORD --watch 2>&1)
7777

scripts/deploy_offseter.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ declare() {
3939
exit 1
4040
fi
4141

42-
# Check if ggrep is available
42+
# Check if ggrep is available
4343
if command -v ggrep >/dev/null 2>&1; then
44-
address=$(echo -e "$output" | ggrep -oP '0x[0-9a-fA-F]+')
44+
address=$(echo -e "$output" | ggrep -oP '0x[0-9a-fA-F]+' | tail -n 1)
4545
else
4646
# If ggrep is not available, use grep
47-
address=$(echo -e "$output" | grep -oP '0x[0-9a-fA-F]\+')
47+
address=$(echo -e "$output" | grep -oP '0x[0-9a-fA-F]+' | tail -n 1)
4848
fi
4949
echo $address
5050
}
@@ -55,7 +55,7 @@ declare() {
5555
# $3 - Min Claimable
5656
# $4 - Owner
5757
deploy() {
58-
class_hash=$(declare | tail -n 1)
58+
class_hash=$(declare)
5959
if [[ $debug == "true" ]]; then
6060
printf "deploy %s %s %s %s %s \n" "$class_hash" "$PROJECT" "$SLOT" "$MIN_CLAIMABLE" "$OWNER" >> debug_offseter.log
6161
fi

scripts/deploy_yielder.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ declare() {
4242

4343
# Check if ggrep is available
4444
if command -v ggrep >/dev/null 2>&1; then
45-
address=$(echo -e "$output" | ggrep -oP '0x[0-9a-fA-F]+')
45+
address=$(echo -e "$output" | ggrep -oP '0x[0-9a-fA-F]+' | tail -n 1)
4646
else
4747
# If ggrep is not available, use grep
48-
address=$(echo -e "$output" | grep -oP '0x[0-9a-fA-F]\+')
48+
address=$(echo -e "$output" | grep -oP '0x[0-9a-fA-F]+' | tail -n 1)
4949
fi
5050
echo $address
5151
}
@@ -56,7 +56,7 @@ declare() {
5656
# $3 - ERC20
5757
# $3 - Owner
5858
deploy() {
59-
class_hash=$(declare | tail -n 1)
59+
class_hash=$(declare)
6060

6161
if [[ $debug == "true" ]]; then
6262
printf "deploy %s %s %s %s %s \n" "$class_hash" "$PROJECT" "$SLOT" "$ERC20" "$OWNER" >> debug_yielder.log

0 commit comments

Comments
 (0)