| 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." |
| 21 | exit 1 |
| 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 | |
| 29 | echo "Ensuring a clean work directory..." |
| 30 | if [ -e $WORK_DIR ] ; then |
| 31 | rm -rf $WORK_DIR/* |
| 32 | fi |
| 33 | mkdir -p $WORK_DIR/chrome |
| 34 | |
| 35 | echo "Copying theme files..." |
| 36 | cp -a $THEME_DIR/* $WORK_DIR/ |
| 37 | cd $WORK_DIR |
| 38 | |
| 39 | echo "Removing x-* files not intended for shipping..." |
| 40 | rm -rf x-* |
| 41 | |
| 42 | echo "Creating new xpi file..." |
| 43 | if [ -e $XPI_FILE ] ; then |
| 44 | rm $XPI_FILE |
| 45 | fi |
| 46 | zip -rX9Dq $XPI_FILE * |
| 47 | |
| 48 | echo "Cleaning work directory..." |
| 49 | rm -rf $WORK_DIR |