You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

69 lines
1.6 KiB

#!/bin/bash
if [ -z $WAPPALYZER_ROOT ]
then
echo "\$WAPPALYZER_ROOT not set"
exit 1
fi
if [ -z $WAPPALYZER_NODE_PATH ]
then
echo "\$WAPPALYZER_NODE_PATH not set"
exit 1
fi
set -eu
wappalyzer validate
echo "Prettifying apps.json..."
node $WAPPALYZER_NODE_PATH/node_modules/jsonlint/lib/cli.js -ist $'\t' $WAPPALYZER_ROOT/src/apps.json
echo "Compressing PNG icons..."
node $WAPPALYZER_NODE_PATH/node_modules/imagemin-cli/cli.js $WAPPALYZER_ROOT/src/icons $WAPPALYZER_ROOT/src/icons -o 7
echo "Compressing SVG icons..."
node $WAPPALYZER_NODE_PATH/node_modules/svgo/bin/svgo -q -f $WAPPALYZER_ROOT/src/icons $WAPPALYZER_ROOT/src/icons
wappalyzer links
# Npm Module
mkdir -p $WAPPALYZER_ROOT/build/wappalyzer_npm/
cp -R $WAPPALYZER_ROOT/src/drivers/npm/* $WAPPALYZER_ROOT/build/wappalyzer_npm/
# Mozilla Firefox
echo "Building Firefox driver..."
pushd $WAPPALYZER_ROOT/src/drivers/firefox > /dev/null
node $WAPPALYZER_NODE_PATH/node_modules/jpm/bin/jpm xpi && mv *.xpi $WAPPALYZER_ROOT/build/wappalyzer_firefox.xpi
popd > /dev/null
# Google Chrome
echo "Building Chrome driver..."
pushd $WAPPALYZER_ROOT/src/drivers/chrome > /dev/null
zip -qr $WAPPALYZER_ROOT/build/wappalyzer_chrome.zip .
popd > /dev/null
# Bookmarklet
echo "Building Bookmarklet driver..."
echo "var json =" > /tmp/bookmarklet
cat $WAPPALYZER_ROOT/src/apps.json >> /tmp/bookmarklet
echo -e ";\n\nwappalyzer.apps = json.apps;\nwappalyzer.categories = json.categories;" >> /tmp/bookmarklet
mv /tmp/bookmarklet $WAPPALYZER_ROOT/src/drivers/bookmarklet/js/apps.js
echo "Done. Builds have been created in $WAPPALYZER_ROOT/build."