From dbbaf9e9dc724e8b411e7d90a6f6a2b421103669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 21 Nov 2018 16:05:08 +0100 Subject: [PATCH] assets/release.sh: obtain version number from package.json. --- assets/release.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/release.sh b/assets/release.sh index 0c18aef..f81eba8 100755 --- a/assets/release.sh +++ b/assets/release.sh @@ -2,8 +2,7 @@ # PACKAGE_NAME="asciiblaster"; -PACKAGE_VERSION="1.0.1"; -RELEASE_DEPS="cpio find gunzip rm tar unzip wget zip"; +RELEASE_DEPS="cpio find gunzip rm sed tar unzip wget zip"; NWJS_PLATFORMS="linux-ia32 linux-x64 win-ia32 win-x64"; NWJS_VERSION="0.34.5"; NWJS_SUBDIR="nwjs-v${NWJS_VERSION}-%NWJS_PLATFORM%"; @@ -36,13 +35,15 @@ subst() { }; release() { - local _platform="${1}" _vflag="${2}" _nwjs_fname="" _nwjs_subdir="" _nwjs_url="" _release_fname="" _release_dname=""; + local _platform="${1}" _vflag="${2}" _nwjs_fname="" _nwjs_subdir="" _nwjs_url="" \ + _release_fname="" _release_dname="" _release_version=""; _nwjs_subdir="$(subst "${NWJS_SUBDIR}" "%NWJS_PLATFORM%" "${_platform}")"; _nwjs_url="$(subst "$(eval echo \"\${NWJS_URL_${_platform%%-*}}\")" "%NWJS_PLATFORM%" "${_platform}")"; _nwjs_fname="${RELEASES_DNAME}/${_nwjs_url##*/}"; _release_dname="${RELEASES_DNAME}/${PACKAGE_NAME}-${PACKAGE_VERSION}-release-${_platform}"; _release_fname="${_release_dname}.zip"; + _release_version="$(sed -n '/^\s\*"version":/s/^.*:\s*"\([0-9.]\+\)",\?\s*$/\1/p' package.json)"; trap "rm -fr ${_nwjs_fname} ${_release_dname}" EXIT HUP INT QUIT PIPE TERM USR1 USR2; if [ "${_vflag:-0}" -eq 0 ]; then