Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Created June 1, 2018 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpluimers/da2b68eb615234cbc9488645f3f8943f to your computer and use it in GitHub Desktop.
Save jpluimers/da2b68eb615234cbc9488645f3f8943f to your computer and use it in GitHub Desktop.
Check Delphi .dproj against files on disk by Attila Kovacs originally from https://pastebin.com/fcsiLc6Q
#!/bin/bash
# !!! Be careful with scripts, always do your backup or play on a copy !!!
if [[ $# -eq 0 ]] ; then
echo 'usage: prfiles.sh project.dproj'
exit 1
fi
declare file_content=$( cat $1 | sed -nr "/DCCReference Include/I{s/(.*)\"(.*)\"(.*)/\2/g;p}" )
shopt -s nocasematch
for i in `find . -name "*.pas" -type f -printf '%f\n'`; do
[[ ! " $file_content " =~ $i ]] && echo $i "not in dproj"
done
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment