-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfixdeps.sh
More file actions
20 lines (17 loc) · 644 Bytes
/
Copy pathfixdeps.sh
File metadata and controls
20 lines (17 loc) · 644 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# fix broken submodules
# Developed by Liam
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key local_path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
branch_key=$(echo $path_key | sed 's/\.path/.branch/')
url=$(git config -f .gitmodules --get "$url_key")
if [[ -n $(git config -f .gitmodules --get "$branch_key") ]] ; then
branch=$(git config -f .gitmodules --get "$branch_key")
echo `git submodule add -b $branch $url $local_path`
else
echo `git submodule add $url $local_path`
fi
done