#!/bin/bash
# Sorry Windows users, upgrade to a better OS
#  -- r/linuxmasterrace

cd platforms/android/app/src/main/assets/www/node_modules

echo "Cleaning up node_modules from www..."

echo "Size before: $(du -sh | cut -d '	' -f 1)"

rm -r {.bin,.yarn-integrity}

rm -r ./{ansicolors,buffer-from,canvas-renderer,cardinal,concat-stream,core-util-is,csscolorparser,dom7}
rm -r ./{earcut,esm,esprima,geojson-vt,gl-matrix,grid-index,ieee754,inherits,isarray,kdbush,@mapbox,minimist,murmurhash-js}
rm -r ./{path-to-regexp,pbf,potpack,process-nextick-args,protocol-buffers-schema,quickselect}
rm -r ./{readable-stream,redeyed,resolve-protobuf-schema,rw,safe-buffer,sharkdown,split,ssr-window,string_decoder}
rm -r ./{supercluster,template7,through,tinyqueue,typedarray,util-deprecate,vt-pbf,wgs84}

rm -r @fortawesome/fontawesome-free/{js,less,scss,sprites,svgs}
rm -r @fortawesome/fontawesome-free/css/{all.css,brands.css,brands.min.css,fontawesome.css,fontawesome.min.css,regular.css,\
regular.min.css,solid.css,solid.min.css,svg-with-js.css,svg-with-js.min.css,v4-shims.css,v4-shims.min.css}

rm -r framework7/{components,less,modules,utils}
rm -r framework7/{framework7.bundle.less,framework7.esm.bundle.d.ts,framework7.esm.bundle.js,framework7.esm.d.ts,framework7.esm.js,framework7.less}
rm -r framework7/css/{framework7.bundle.css,framework7.bundle.rtl.css,framework7.bundle.rtl.min.css,framework7.css,framework7.min.css,framework7.rtl.css,framework7.rtl.min.css}
rm -r framework7/js/{framework7.bundle.d.ts,framework7.bundle.js,framework7.d.ts,framework7.js,framework7.min.js,framework7.min.js.map}

rm -r jdenticon/{src,index.js,dist/jdenticon.js}

rm -r jquery/{external,src}
rm -r jquery/dist/{core.js,jquery.js,jquery.slim.js,jquery.slim.min.js,jquery.slim.min.map}

rm -r mapbox-gl/{build,CHANGELOG.md,flow-typed,node_modules,src}
rm -r mapbox-gl/dist/{mapbox-gl-csp.js,mapbox-gl-csp.js.map,mapbox-gl-csp-worker.js,mapbox-gl-csp-worker.js.map,mapbox-gl-dev.js,\
mapbox-gl-dev.js.flow,mapbox-gl.js.flow,mapbox-gl.js.map,mapbox-gl-unminified.js,mapbox-gl-unminified.js.map,style-spec}

echo "Size after: $(du -sh | cut -d '	' -f 1)"

echo "Cleanup complete!"
