blob: fceb2fde62c4b05aec6ffac018cfe328758cbaa7 [file] [log] [blame]
#!/bin/bash
# Zip the files needed for this extension, excluding screenshots, promotional
# images, and backup files.
# Constants
readonly ZIP_FILE='go-back-with-backspace.zip'
# The individual icon files are listed so an error will be raised if one is
# missing.
declare -ar ZIP_CONTENTS=(_locales/
icons/
icons/icon16.png
icons/icon32.png
icons/icon48.png
icons/icon128.png
content_script.js
is_editable.js
manifest.json
readme.txt)
# Remove backup files.
rm -f $(find . -name \*~ -or -name \#\*\#)
if ! mkdir icons; then
echo "Error creating icons/ directory" >&2
exit 1
fi
if ! cp assets/icon*.png icons/; then
echo "No icon images found in icons/" >&2
exit 2
fi
rm -f "${ZIP_FILE}"
if ! zip -r --quiet --must-match "${ZIP_FILE}" "${ZIP_CONTENTS[@]}"; then
echo "Error zipping required files (${ZIP_CONTENTS[@]})" >&2
exit 3
fi