diff --git a/build.sh b/build.sh index 05fb14f57221ec411a296a92e8194311ca33dcf4..0d8fbdb3f89d891d747fae9c70d3d3be688e1b0a 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