<commit_before>#!/bin/sh

# derive project name and version
PROJ=`awk '/^content/{print $2}' chrome.manifest`
rm -f ${PROJ}*.xpi
VER=`sed -n -e '/em:version/{s/[^0-9.]//g;p}' install.rdf`

echo BUILDING...

rm -fr build
mkdir build

# make build tree
find . -name '.svn' -prune -false -o -name 'build' -prune -false -o \
	-type d -not -name '.svn' -a -not -name 'build'  -a -not -name '.' \
	-exec mkdir "build/{}" \;
# copy files in
find . -name '.svn' -prune -false -o -name 'build' -prune -false -o \
	-type f -not -name 'package.sh' \
	-exec cp "{}" "build/{}" \;

cd build

# create the jar, patch the manifest to reference it
echo CREATING: "${PROJ}.jar"

sed \
	-e "/^content/s/\(.*\) \(.*\)/\1 jar:${PROJ}.jar!\/\2/" \
	-e "/^skin/s/\(.*\) \(.*\)/\1 jar:${PROJ}.jar!\/\2/" \
	-e "/^locale/s/\(.*\) \(.*\)/\1 jar:${PROJ}.jar!\/\2/" \
	chrome.manifest > chrome.manifest.jar
mv chrome.manifest.jar chrome.manifest

find content/ skin/ locale/ | \
	zip -r -0 -@ "${PROJ}.jar" > /dev/null
rm -fr content/ skin/ locale/

# zip together the jar and the rest into the xpi
echo CREATING: "${PROJ}-${VER}.xpi"
zip -r -9 "../${PROJ}-${VER}.xpi" * > /dev/null

cd ..
rm -rf build/<commit_msg>fix package script, jar inside chrome directory<commit_after>#!/bin/sh

[ ! -f "chrome.manifest" ] && echo "Must execute from main extension directory!" && exit

# derive project name and version
PROJ=`awk '/^content/{print $2}' chrome.manifest`
rm -f ${PROJ}*.xpi
VER=`sed -n -e '/em:version/{s/[^0-9.]//g;p}' install.rdf`

echo BUILDING...

rm -fr build
mkdir build

# make build tree
find . -name '.svn' -prune -false -o -name 'build' -prune -false -o \
	-type d -not -name '.svn' -a -not -name 'build'  -a -not -name '.' \
	-exec mkdir "build/{}" \;
# copy files in
find . -name '.svn' -prune -false -o -name 'build' -prune -false -o \
	-type f -not -name 'package.sh' \
	-exec cp "{}" "build/{}" \;

cd build

# create the jar, patch the manifest to reference it
echo CREATING: "${PROJ}.jar"

sed \
	-e "/^content/s#\(.*\) \(.*\)#\1 jar:chrome/${PROJ}.jar!/\2#" \
	-e "/^skin/s#\(.*\) \(.*\)#\1 jar:chrome/${PROJ}.jar!/\2#" \
	-e "/^locale/s#\(.*\) \(.*\)#\1 jar:chrome/${PROJ}.jar!/\2#" \
	chrome.manifest > chrome.manifest.jar
mv chrome.manifest.jar chrome.manifest

find content/ skin/ locale/ | \
	zip -r -0 -@ "${PROJ}.jar" > /dev/null
rm -fr content/ skin/ locale/
mkdir chrome
mv "${PROJ}.jar" chrome

# zip together the jar and the rest into the xpi
echo CREATING: "${PROJ}-${VER}.xpi"
zip -r -9 "../${PROJ}-${VER}.xpi" * > /dev/null

cd ..
rm -rf build/
{'fraction_non_alphanumeric': 0.24227005870841486, 'fraction_numerical': 0.008610567514677104, 'mean_word_length': 2.569832402234637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2909802', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1015, 'n_words': 308}