Merge pull request #1232 from DaAwesomeP/master

Fix svg2png in tests, fix image compression
main
Elbert Alias 8 years ago committed by GitHub
commit 3b7c111b8a

@ -1,6 +1,6 @@
language: node_js language: node_js
node_js: node_js:
- "4" - "node"
sudo: false sudo: false
before_install: before_install:
- export WAPPALYZER_ROOT=$TRAVIS_BUILD_DIR - export WAPPALYZER_ROOT=$TRAVIS_BUILD_DIR

@ -22,13 +22,9 @@ echo "Prettifying apps.json..."
node $WAPPALYZER_NODE_PATH/node_modules/jsonlint/lib/cli.js -ist $'\t' $WAPPALYZER_ROOT/src/apps.json node $WAPPALYZER_NODE_PATH/node_modules/jsonlint/lib/cli.js -ist $'\t' $WAPPALYZER_ROOT/src/apps.json
echo "Compressing PNG icons..." echo "Compressing PNG and SVG icons..."
node $WAPPALYZER_NODE_PATH/node_modules/imagemin-cli/cli.js $WAPPALYZER_ROOT/src/icons $WAPPALYZER_ROOT/src/icons -o 7 node $WAPPALYZER_NODE_PATH/node_modules/imagemin-cli/cli.js $WAPPALYZER_ROOT/src/icons/* $WAPPALYZER_ROOT/src/icons
echo "Compressing SVG icons..."
node $WAPPALYZER_NODE_PATH/node_modules/svgo/bin/svgo -q -f $WAPPALYZER_ROOT/src/icons $WAPPALYZER_ROOT/src/icons
echo "Converting SVG icons to PNG..." echo "Converting SVG icons to PNG..."
@ -42,12 +38,16 @@ do
dest="$WAPPALYZER_ROOT/src/icons/converted/$(basename "$svg").png" dest="$WAPPALYZER_ROOT/src/icons/converted/$(basename "$svg").png"
if [[ ! -f "$dest" ]]; then if [[ ! -f "$dest" ]]; then
svg2png "$svg" --width=32 --height=32 --output "$dest" || true node $WAPPALYZER_NODE_PATH/node_modules/svg2png/bin/svg2png-cli "$svg" --width=32 --height=32 --output "$dest" || true
fi fi
done done
IFS="$OIFS" IFS="$OIFS"
echo "Compressing converted PNG icons..."
node $WAPPALYZER_NODE_PATH/node_modules/imagemin-cli/cli.js $WAPPALYZER_ROOT/src/icons/converted/* $WAPPALYZER_ROOT/src/icons/converted
wappalyzer links wappalyzer links
# Npm Module # Npm Module

@ -39,7 +39,6 @@ RUN su wappalyzer -c "mkdir $WAPPALYZER_NODE_PATH"
ADD node/package.json $WAPPALYZER_NODE_PATH/package.json ADD node/package.json $WAPPALYZER_NODE_PATH/package.json
RUN npm i -g npm svg2png --prefix=/usr/local
RUN ln -s -f /usr/local/bin/npm /usr/bin/npm RUN ln -s -f /usr/local/bin/npm /usr/bin/npm
RUN su wappalyzer -c "cd $WAPPALYZER_NODE_PATH && npm i" RUN su wappalyzer -c "cd $WAPPALYZER_NODE_PATH && npm i"

@ -12,14 +12,14 @@
"test": "./bin/wappalyzer build" "test": "./bin/wappalyzer build"
}, },
"devDependencies": { "devDependencies": {
"file-type": "3.4.*", "file-type": "3.8.*",
"is-svg": "1.1.*", "is-svg": "2.0.*",
"read-chunk": "1.0.*", "read-chunk": "2.0.*",
"jsonlint": "*", "jsonlint": "*",
"jpm": "*", "jpm": "*",
"imagemin-cli": "*", "imagemin-cli": "2.*.*",
"phantomjs-prebuilt": "*", "phantomjs-prebuilt": "*",
"svgo": "*" "svg2png": "3.*.*"
}, },
"engines": { "engines": {
"node": ">= 4" "node": ">= 4"

Loading…
Cancel
Save