From fcd3bb52e5b8de8123e92f7f5cbad97d8e1b72e9 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 12 Aug 2020 16:06:30 -0600 Subject: [PATCH] Fix script --- scripts/remove_bloat.sh | 43 ++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/scripts/remove_bloat.sh b/scripts/remove_bloat.sh index e163a84..cff38f5 100755 --- a/scripts/remove_bloat.sh +++ b/scripts/remove_bloat.sh @@ -4,13 +4,15 @@ echo "Removing bloat in node_modules..." -pwd +set -e -cd www/node_modules -rm -rf {ansicolors,buffer-from,cardinal,chartjs-color,chartjs-color-string,color-convert,color-name,concat-stream,core-util-is,csscolorparser} -rm -rf {dom7,earcut,esprima,geojson-vt,gl-matrix,grid-index,ieee754,inherits,isarray} -rm -rf {kdbush,leaflet-geometryutil,@mapbox,minimist,murmurhash-js} -rm -rf {path-to-regexp,pbf,potpack,process-nextick-args} +DIR="$(pwd)/www/node_modules" + +cd $DIR +rm -rf {ansicolors,buffer-from,cardinal,chartjs-color,chartjs-color-string,color-convert,color-name} +rm -rf {concat-stream,core-util-is,csscolorparser,dom7,earcut,esprima,geojson-vt} +rm -rf {gl-matrix,grid-index,ieee754,inherits,isarray,kdbush,leaflet-geometryutil,@mapbox,minimist} +rm -rf {moment,murmurhash-js,path-to-regexp,pbf,potpack,process-nextick-args} rm -rf {protocol-buffers-schema,quickselect,readable-stream,redeyed,resolve-protobuf-schema} rm -rf {rw,safe-buffer,sharkdown,split,ssr-window,string_decoder,supercluster} rm -rf {template7,text-encoding,through,tinyqueue,ts-custom-error,typedarray} @@ -19,21 +21,22 @@ rm -rf {util-deprecate,vt-pbf,wgs84} # Make npm stop complaining that these don't exist by actually removing them rm -rf .bin/* +cd $DIR + cd bwip-js rm -rf {bin,examples,src,barcode.ps,demo.html,stb_truetype.h} rm -rf dist/bwip-js.js rm -rf dist/node-bwipjs.js -cd .. +cd $DIR -cd chart.js -cd dist +cd chart.js/dist rm {Chart.bundle.js,Chart.css,Chart.js} -cd ../.. +cd $DIR cd @fortawesome/fontawesome-free rm -rf {js,less,metadata,scss,sprites,svgs} find css -type f -not -name 'all.min.css' -delete -cd ../.. +cd $DIR cd framework7 rm -rf components @@ -45,52 +48,52 @@ rm -f framework7.* rm -f framework7-lite.* find css -type f -not -name 'framework7.bundle.min.css' -delete find js -type f -not -name 'framework7.bundle.min.js' -delete -cd .. +cd $DIR cd jquery rm -rf src rm -rf external find dist -type f -not -name 'jquery.min.js' -delete -cd .. +cd $DIR cd jsbarcode rm -rf .dockerignore .eslintignore .eslintrcautomation bower.json CONTRIBUTING.md docker-compose.yml Dockerfile example gulpfile.js jsbarcode.d.ts README.md src test .travis.yml rm -rf {automation,bin} rm -rf dist/barcodes rm -rf dist/JsBarcode.all.js -cd .. +cd $DIR cd leaflet rm -rf {CHANGELOG.md,src} find dist -type f -not -name 'leaflet.css' -not -name 'leaflet.js' -delete -cd .. +cd $DIR cd leaflet.locatecontrol rm -rf {CHANGELOG.md,README.md,src} find dist -type f -not -name 'L.Control.Locate.min.css' -not -name 'L.Control.Locate.min.js' -delete -cd .. +cd $DIR cd leaflet.markercluster rm -rf {build,example,spec,src,CHANGELOG.md} find dist -type f -not -name 'leaflet.markercluster.js' -not -name 'MarkerCluster.css' -not -name 'MarkerCluster.Default.css' -delete -cd .. +cd $DIR cd material-design-icons # Remove everything except the icon font and license, but also exclude the # current and parent folder (. , ..) so rm won't complain about refusing # to delete the whole filesystem find . -maxdepth 1 -not -name '.' -not -name 'LICENSE' -not -name 'iconfont' -exec rm -rf {} \; -cd .. +cd $DIR cd mapbox-gl rm -rf {build,flow-typed,src} find dist -type f -not -name 'mapbox-gl.css' -not -name 'mapbox-gl.js' -delete rm -rf dist/style-spec -cd .. +cd $DIR cd @zxing/library rm -rf {esm,esm5} rm -f umd/index.min.js.map -cd ../.. +cd $DIR echo "Cleanup finished"