Skip to content

Instantly share code, notes, and snippets.

@joelcardinal
Created November 24, 2015 17:08
Show Gist options
  • Save joelcardinal/5a22db0b3e8079fd4dda to your computer and use it in GitHub Desktop.
Save joelcardinal/5a22db0b3e8079fd4dda to your computer and use it in GitHub Desktop.
Quick bash script to discover static files not used in Demandware codebase
#!/bin/bash
# Quick script to discover static files not used in codebase
# to create fileList.txt
# ls -1R ./workspace2/app_core/cartridge/static > imgList.txt
# then dedupe...
# This script needs to go in parent dir of "workspace" dir
while read p; do
if grep -rlq --exclude-dir=*\.{svn,plugins,metadata,git} "$p" ./workspace;then
echo $p
else
echo $p >> filesNotFound.txt
fi
done <fileList.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment