about summary refs log tree commit diff
path: root/reset-submodules.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xreset-submodules.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/reset-submodules.sh b/reset-submodules.sh
new file mode 100755
index 0000000..60f2267
--- /dev/null
+++ b/reset-submodules.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+find . -type d | grep --invert '\.git' | while read dir
+do
+    (
+        (git -C $dir submodule init 2>/dev/null) \
+        && (git -C $dir submodule update 2>/dev/null)
+    ) || echo $dir does not contain submodules
+done