Created
March 13, 2015 15:43
-
-
Save petertoi/79d77b041f1f8f93c456 to your computer and use it in GitHub Desktop.
Performs a recursive scan from the current directory for the specified file and outputs matched files and plugin version
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/sh | |
# | |
# Author: Peter Toi | |
# Source: https://gist.github.com/petertoi/79d77b041f1f8f93c456 | |
# | |
# Usage 1: $ check_plugin_version.sh # No argument will prompt for plugin file name | |
# Usage 2: $ check_plugin_version.sh pluginfile # Skip the prompts by including the file name as an argument | |
if [ "$#" -eq 1 ] | |
then | |
pluginfile=$1 | |
else | |
echo "Main plugin PHP file name (Ex: wp-seo.php): " | |
read pluginfile | |
fi | |
for filename in $(find ./ -type f -name $pluginfile) | |
do | |
echo "$filename:$(head -n 20 $filename | grep "Version")" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment