-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit
More file actions
executable file
·22 lines (17 loc) · 739 Bytes
/
init
File metadata and controls
executable file
·22 lines (17 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
echo "Initializing submodules"
git submodule init
# Get a list of all submodule paths defined in .gitmodules
SUBMODULE_PATHS=$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }')
if [ -z "$SUBMODULE_PATHS" ]; then
echo "No submodules found in .gitmodules"
exit 0
fi
for path in $SUBMODULE_PATHS
do
echo "Attempting update for: $path"
# Try to update the specific submodule.
# Use '||' to catch errors (like permission denied for private repos) and allow the script to continue.
GIT_TERMINAL_PROMPT=0 git submodule update --init --remote --merge -- "$path" || echo "WARN: Failed to update $path. Skipping (might be private or unreachable)."
done
echo "Finished attempting submodule updates"