#!/bin/sh set -e usage() { echo 'Usage: create-release.sh dir [--tag] [--upload]' echo echo 'Creates a zip for themes download and optionally tags the git tree and uploads to our files server' } if [ "x$1" = "x-h" -o "x$1" = "x--help" ] ; then usage exit 0 fi if [ $# -eq 0 ] ; then usage exit 1 fi THEME="${1%/}" ./lint-theme.sh $THEME if [ ! -f $THEME/theme.json ] ; then echo echo "Please ensure that you have updated data/themes.py in the website code before running this script." fi cat < $NAME.zip.sha1 sha256sum $NAME.zip > $NAME.zip.sha256 cd .. echo "Release files:" ls -la release/$NAME.zip if [ $TAG -eq 1 ] ; then git tag -s -a -m "Tagging release of theme $THEME $VERSION" $NAME fi if [ $UPLOAD -eq 1 ] ; then sftp -P 11022 -f -b - files@hertz.phpmyadmin.net <