Newer
Older
BASEDIR="$( cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null 2>&1 && pwd )"
BUILDDIR="$BASEDIR/build"
SHAREDDIR="$BASEDIR/shared"
for target in "${TARGETS[@]}" ; do
targetdir="$BUILDDIR/$target"
[ -d "$targetdir" ] && rm -r "$targetdir"
mkdir -p "$targetdir"
cp -r "$SHAREDDIR"/* "$targetdir"
cp -r "$sourcedir"/* "$targetdir"
rm "$targetdir"/manifest.part.json
if [ -z "${DEBUG:-}" ] ; then
for file in "$targetdir"/*.js ; do
sed -i -e '/\/\/ DEBUG$/d' "$file"
done
fi
python3 "$BASEDIR/scripts/makemanifest.py" \
"$SHAREDDIR/manifest.part.json" \
"$sourcedir/manifest.part.json" \
> "$targetdir/manifest.json"
(cd "$targetdir" ; zip -r "$outputfile" *)
echo "[-] output to '$outputfile'"