Last active
March 13, 2018 12:13
-
-
Save ohader/dd76710c1afdd5d28af7b3cf844e716a to your computer and use it in GitHub Desktop.
TYPO3 Core: Search for similar documentation *.rst files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################################################## | |
# searching for similar documentation *.rst files in e.g. | |
# typo3/sysext/core/Documentation/Changelog organized in | |
# different sub-directories | |
# | |
# @license MIT | |
# @author Oliver Hader <oliver@typo3.org> | |
############################################################################################## | |
### | |
# Usage: | |
# cd typo3/sysext/core/Documentation/Changelog | |
# ~/typo3-documentation-compare.sh | |
### | |
otherDirectoryExclude="" | |
fileExcludePattern="Index.rst" | |
for currentDirectory in $(find * -type d) | |
do | |
echo "* scanning $currentDirectory" | |
otherDirectoryExlude="! -wholename $currentDirectory $otherDirectoryExlude" | |
# `-I` to ignore, not available for unix `ls` | |
for currentFile in $(ls -1 -c $currentDirectory *.rst | grep -v $fileExcludePattern) | |
do | |
for otherDirectory in $(find * -type d $otherDirectoryExlude) | |
do | |
if [ -e $otherDirectory/$currentFile ] | |
then | |
echo " + $currentDirectory/$currentFile -> $otherDirectory/$currentFile" | |
fi | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment