#!/bin/bash # Bail out if there are any errors set -e # There's probably a way to do this in the Makefile, but I couldn't figure # out how, so I'm doing it here. This script just tars up all the files, # excluding the demos that are not ready for release. # This script expects to be called with the TWHOME directory as its first # arg. It is defined in the Makefile. TWHOME=$1 export TW_VERSION=tw-`cat VERSION` echo "TW_VERSION is ${TW_VERSION}" echo "TWHOME is ${TWHOME}" cd ${TWHOME} cd .. if [ -d ${TW_VERSION} ]; then echo "Directory ${TW_VERSION} already exists; assuming a re-release" rm -rf ${TW_VERSION} fi echo "Copying ${TWHOME} to ${TW_VERSION}" cp -ar ${TWHOME} ${TW_VERSION} cd ${TW_VERSION} make clean rm -rf omit cd .. tarfile=${TW_VERSION}.tgz if [ -e $tarfile ]; then echo "removing old tarball $tarfile" rm $tarfile fi echo "Creating tarball $tarfile" tar --create -z --file=$tarfile ${TW_VERSION}