Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 54 lines (46 sloc) 1.408 kb
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
#!/bin/sh

# Set up variables
if [ "amo" == "$1" ] || [ "staging" == "$1" ]; then
  # For official builds, use the version in install.rdf.
  VER=`grep -Go 'em:version\>\(.*\)\<' extension/install.rdf | grep -Go '>\(.*\)<' | sed -e 's/[><]*//g'`
elif [ "test" == "$1" ]; then
  VER=`echo test`
else
  # For beta builds, generate a version number.
  VER=`date +"%Y.%m.%d.beta"`
fi
XPI="scriptish-$VER.xpi"

# Copy base structure to a temporary build directory and change to it
if [ "test" != "$1" ]; then
  echo "Creating working directory ..."
fi
rm -rf build
mkdir build
cp LICENSE.txt build/
cd extension
cp -r \
  chrome.manifest components content defaults install.rdf license \
      locale modules skin \
  ../build/
cd ../build

sed -e 's/extension\/license/license/g' LICENSE.txt > LICENSE.txt.$$
mv LICENSE.txt.$$ LICENSE.txt

if [ "amo" = "$1" ]; then
  (sed -e 's/<em\:update.*//g' install.rdf > install.rdf.$$ &&
   mv install.rdf.$$ install.rdf)
fi

(sed -e 's/<!--.*//g' install.rdf > install.rdf.$$ &&
 mv install.rdf.$$ install.rdf)

if [ "test" != "$1" ]; then
  echo "Cleaning up unwanted files ..."
  find . -depth -name '*~' -exec rm -rf "{}" \;
  find . -depth -name '#*' -exec rm -rf "{}" \;
  find . -depth -name '.DS_Store' -exec rm "{}" \;
fi

echo "Creating $XPI ..."
zip -qr9XD "../$XPI" *

if [ "test" != "$1" ]; then
  echo "Cleaning up temporary files ..."
fi
cd ..
rm -rf build
Something went wrong with that request. Please try again.