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
node_js:
- "4"
- "node"
sudo: false
before_install:
- 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
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
echo "Compressing SVG icons..."
node $WAPPALYZER_NODE_PATH/node_modules/svgo/bin/svgo -q -f $WAPPALYZER_ROOT/src/icons $WAPPALYZER_ROOT/src/icons
node $WAPPALYZER_NODE_PATH/node_modules/imagemin-cli/cli.js $WAPPALYZER_ROOT/src/icons/* $WAPPALYZER_ROOT/src/icons
echo "Converting SVG icons to PNG..."
@ -42,12 +38,16 @@ do
dest="$WAPPALYZER_ROOT/src/icons/converted/$(basename "$svg").png"
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
done
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
# Npm Module

@ -39,7 +39,6 @@ RUN su wappalyzer -c "mkdir $WAPPALYZER_NODE_PATH"
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 su wappalyzer -c "cd $WAPPALYZER_NODE_PATH && npm i"

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