-
-
Save fgdrf/b2a3bec327a4e7affab3 to your computer and use it in GitHub Desktop.
change package structure with git mv
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
function change_java_packages | |
{ | |
java_files=`find $1 -name "*.java" -type f -print` | |
created_folders=0 | |
for jf in $java_files | |
do | |
path_to=`echo $jf | awk -F'net\/refractions\/udig\/' '{print $1}'` | |
within_path=`echo $jf | awk -F'net\/refractions\/udig\/' '{print $2}'` | |
if [ "$path_to" != "" ]; then | |
echo $path_to | |
if [ "$created_folders" = "0" ]; then | |
if [ ! -d "$path_to/org" ]; then | |
mkdir -p "$path_to/org" | |
fi | |
if [ ! -d "$path_to/org/locationtech" ]; then | |
mkdir -p "$path_to/org/locationtech" | |
fi | |
if [ ! -d "$path_to/org/locationtech/udig" ]; then | |
echo "mv udig folder to $path_to/org/locationtech" | |
git mv "$path_to/net/refractions/udig" "$path_to/org/locationtech/udig" | |
fi | |
created_folders=1 | |
fi | |
fi | |
done | |
} | |
plugin_list=`find $c_path/plugins -d 1 -type d -print` | |
for plugin in $plugin_list | |
do | |
change_java_packages "$plugin" "$search_folder" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment