Add submodule-update-foreach.sh and a post-pull hook for it
[config/vcsh.git] / .config / vcsh / hooks-available / submodule-update-foreach.sh
diff --git a/.config/vcsh/hooks-available/submodule-update-foreach.sh b/.config/vcsh/hooks-available/submodule-update-foreach.sh
new file mode 100755 (executable)
index 0000000..3405942
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+: "${XDG_CONFIG_HOME:="$HOME/.config"}"
+
+# XXX This should really be a normal post-pull hook, but vcsh lacks
+# per-repository pull/push hooks, see
+# https://github.com/RichiH/vcsh/issues/213
+
+echo "Updating submodules..."
+vcsh foreach -g "$XDG_CONFIG_HOME/vcsh/hooks-available/submodule-update.sh"