From e07b797124a7c8d9127f1114ac01230e28c88bad Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 7 Nov 2017 16:38:30 -0200 Subject: Adds git-submodule-move-all-git-dirs --- git-submodule-move-all-git-dirs | 20 ++++++++++++++++++++ git-submodule-move-git-dir | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 git-submodule-move-all-git-dirs diff --git a/git-submodule-move-all-git-dirs b/git-submodule-move-all-git-dirs new file mode 100755 index 0000000..41a7352 --- /dev/null +++ b/git-submodule-move-all-git-dirs @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Call git-submodule-move-git-dir for each repository in a tree +# + +# Parameters +BASENAME="`basename $0`" + +# Checks +if [ ! -e ".git" ]; then + echo "please run this command in the top-level repository folder" + exit 1 +fi + +# If we invert find results so we begin conversion at the toplevel folders +#find -type f -name .git | tac | while read repo; do +find -type f -name .git | while read repo; do + folder="`dirname $repo`" + git-submodule-move-git-dir $folder +done diff --git a/git-submodule-move-git-dir b/git-submodule-move-git-dir index b30f247..8c28e66 100755 --- a/git-submodule-move-git-dir +++ b/git-submodule-move-git-dir @@ -27,7 +27,7 @@ elif [ ! -d "$MODULE" ]; then elif [ -d "$MODULE/.git" ]; then echo "module $MODULE already converted" exit 1 -elif [ ! -d ".git" ]; then +elif [ ! -e ".git" ]; then echo "please run this command in the top-level repository folder" exit 1 fi -- cgit v1.2.3