forked from jhs/google-app-engine
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·61 lines (50 loc) · 1.63 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#
# Script to build an App Engine Console distribution.
#
# This file is part of App Engine Console.
#
# App Engine Console is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# App Engine Console is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with App Engine Console; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
source version.sh
if [ ! "$git_tag" ]; then
echo "This script must run on a tagged revision." >&2
echo "Current tags:" >&2
git tag | sed 's/^/ - /' >&2
exit 1
fi
package="AppEngineConsole-$git_tag"
target="$PWD/$package"
zipfile="$PWD/$package.zip"
echo "Building $zipfile"
set -e
rm -vf "$zipfile"
mkdir -p "$target"
allow_modified=0
if [ -z "$allow_modified" ]; then
if ! git diff-index --quiet --cached "$git_tag" --; then
echo 'Error: This checkout has been modified from the tagged version' >&2
exit 1
fi
if ! git diff-files --quiet; then
echo 'Error: This checkout has been modified from the tagged version' >&2
exit 1
fi
fi
cp -r console/console "$target/console"
# Prepare for packaging.
find "$target" -type f -name '*.py[co]' -exec rm {} \;
cd "$target"
zip -r "$zipfile" console
cd ..
rm -rf "$target"