From 90b3f8d5e778697b52518ada441b7f39fbccf3c5 Mon Sep 17 00:00:00 2001 From: Han Tianle Date: Thu, 16 Feb 2023 15:06:04 +0800 Subject: [PATCH] feat: Modify build.sh --story=0 --- build.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 05fb14f..0d8fbdb 100755 --- a/build.sh +++ b/build.sh @@ -1,14 +1,12 @@ #!/bin/bash -DIR="/home/contract_docker_go/target/release/" - -if [ ! -d $DIR ]; then - mkdir -p $DIR +contractName=$1 +if [[ ! -n $contractName ]] ;then + echo "contractName is empty. use as: ./build.sh contractName" + exit 1 fi -echo "please input zip file name (no suffix): " -read zip_file -go build -ldflags="-s -w" -o $zip_file +go build -ldflags="-s -w" -o $contractName -7z a $zip_file $zip_file -mv $zip_file.7z $DIR \ No newline at end of file +7z a $contractName $contractName +rm -f $contractName \ No newline at end of file -- GitLab