Commit | Line | Data |
---|---|---|
738054be RK |
1 | #!/bin/sh |
2 | ||
3 | RUN_DIR=$(pwd) | |
4 | cd $(dirname "$0") | |
5 | SCRIPT_DIR=$(pwd) | |
6 | ||
7 | if [ -n "$1" ]; then | |
8 | case "$1" in | |
9 | EarlyBlue) | |
10 | THEME_NAME=$1 | |
11 | ;; | |
12 | LCARStrek) | |
13 | THEME_NAME=$1 | |
14 | ;; | |
15 | *) | |
16 | echo "unknown theme $option" | |
17 | ;; | |
18 | esac | |
19 | else | |
20 | echo "You must specify a theme name." | |
39d844b6 | 21 | exit 1 |
738054be RK |
22 | fi |
23 | ||
24 | # define variables | |
25 | THEME_DIR=$SCRIPT_DIR/$THEME_NAME/ | |
26 | WORK_DIR=$SCRIPT_DIR/$THEME_NAME.tmp/ | |
27 | XPI_FILE=$SCRIPT_DIR/$THEME_NAME.xpi | |
28 | ||
dae80f0c | 29 | echo "Ensuring a clean work directory..." |
738054be RK |
30 | if [ -e $WORK_DIR ] ; then |
31 | rm -rf $WORK_DIR/* | |
32 | fi | |
33 | mkdir -p $WORK_DIR/chrome | |
34 | ||
dae80f0c | 35 | echo "Copying theme files..." |
e5e67702 | 36 | cp -a $THEME_DIR/* $WORK_DIR/ |
738054be RK |
37 | cd $WORK_DIR |
38 | ||
dae80f0c | 39 | echo "Removing x-* files not intended for shipping..." |
e5e67702 | 40 | rm -rf x-* |
738054be | 41 | |
dae80f0c | 42 | echo "Creating new xpi file..." |
738054be RK |
43 | if [ -e $XPI_FILE ] ; then |
44 | rm $XPI_FILE | |
45 | fi | |
46 | zip -rX9Dq $XPI_FILE * | |
47 | ||
dae80f0c | 48 | echo "Cleaning work directory..." |
99d068f3 | 49 | rm -rf $WORK_DIR |