diff dist.sh @ 9:d666b9fe5663

dist.sh builds an executable zip file
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sat, 20 Sep 2014 06:44:47 +0200
parents
children 07d74b88ac8d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dist.sh	Sat Sep 20 06:44:47 2014 +0200
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+ZIP_FILE="RemoteViewer.zip"
+
+if [ -d $ZIP_FILE ]; then
+	rm $ZIP_FILE
+fi
+
+# make sure all resources are generated before byte-compiling
+make
+
+python -m compileall .
+
+for file in `find . -name \*\.pyc -print`; do
+	echo $file
+	if [[ $file =~ (.*)__pycache__/(.*)\.cpython-..(.*) ]]; then
+		target="${BASH_REMATCH[1]}${BASH_REMATCH[2]}${BASH_REMATCH[3]}"
+		cp $file $target
+		rm $file
+	else
+		echo 'no match'
+		exit 1
+	fi
+done
+
+find . -name \*.pyc -print | xargs zip -@ $ZIP_FILE