comparison 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
comparison
equal deleted inserted replaced
8:fc866be7843c 9:d666b9fe5663
1 #!/bin/bash
2
3 ZIP_FILE="RemoteViewer.zip"
4
5 if [ -d $ZIP_FILE ]; then
6 rm $ZIP_FILE
7 fi
8
9 # make sure all resources are generated before byte-compiling
10 make
11
12 python -m compileall .
13
14 for file in `find . -name \*\.pyc -print`; do
15 echo $file
16 if [[ $file =~ (.*)__pycache__/(.*)\.cpython-..(.*) ]]; then
17 target="${BASH_REMATCH[1]}${BASH_REMATCH[2]}${BASH_REMATCH[3]}"
18 cp $file $target
19 rm $file
20 else
21 echo 'no match'
22 exit 1
23 fi
24 done
25
26 find . -name \*.pyc -print | xargs zip -@ $ZIP_FILE