Skip to content

Instantly share code, notes, and snippets.

@retornam
Created September 9, 2010 18:38
Show Gist options
  • Save retornam/572304 to your computer and use it in GitHub Desktop.
Save retornam/572304 to your computer and use it in GitHub Desktop.
##replacenameofext with your extension name
#!/bin/bash
# short-name or xpi files name.
EXT_NAME=nameofext
## Must be lowercase with no spaces
CHROME_PROVIDERS="content"
# # which chrome providers we have
## (space-separated list)
ROOT_DIRS="defaults"
# ...and these directories
## (space separated list)
ROOT_DIR=`pwd`
TMP_DIR=build
# remove any left-over files
##from previous builds
rm -f $EXT_NAME.xpi
rm -rf $TMP_DIR
mkdir -p $TMP_DIR/chrome/content
cp -v -R chrome/*.* $TMP_DIR/chrome
cp -v -R content $TMP_DIR/chrome
cp -v -R locale $TMP_DIR/chrome
cp -v -R skin $TMP_DIR/chrome
cp -v -R defaults $TMP_DIR
cp -v install.rdf $TMP_DIR
cp -v chrome.manifest $TMP_DIR
# generate the XPI file
cd $TMP_DIR
echo "Generating $EXT_NAME.xpi..."
zip -r ../$EXT_NAME.xpi *
cd "$ROOT_DIR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment