Create update.sh

Signed-off-by: vvzvlad <github@vvzvlad.xyz>
This commit is contained in:
vvzvlad 2024-06-08 20:13:10 +03:00 committed by GitHub
parent f6bcbb181e
commit 19825d5561
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

21
update.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <wallet_address> <private_key>"
exit 1
fi
WALLET_ADDRESS=$1
PRIVATE_KEY=$2
# Список файлов
FILES=(
"./projects/hello-world/container/config.json"
"./projects/hello-world/contracts/Makefile"
)
for FILE in "${FILES[@]}"; do
EXPANDED_FILE=$(eval echo "$FILE")
sed -i "s/###WALLET_ADDRESS###/$WALLET_ADDRESS/g" "$EXPANDED_FILE"
sed -i "s/###PRIVATE_KEY###/$PRIVATE_KEY/g" "$EXPANDED_FILE"
done