From d5516c72697cd899fac147cc3f93981ea5918c07 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 15 Aug 2016 10:18:13 +0200 Subject: [PATCH] Finished build script to compress dist project file --- build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) mode change 100644 => 100755 build.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index d3b80309..6dc1afcc --- a/build.sh +++ b/build.sh @@ -1,6 +1,13 @@ #!/usr/bin/env bash set -e +if [ "$#" -ne 1 ]; then + echo "Usage:" >&2 + echo " $0 {version}" >&2 + exit 1 +fi + +version=$1 builtcontent=$(readlink -f '../shlink_build_tmp') projectdir=$(pwd) @@ -32,3 +39,6 @@ rm -f config/params/{*,.gitignore} rm -f config/autoload/{{,*.}local.php{,.dist},.gitignore} # Compressing file +rm -f "${projectdir}"/build/Shlink_${version}.dist.zip +zip -r "${projectdir}"/build/Shlink_${version}.dist.zip "${builtcontent}" +rm -rf "${builtcontent}"