]> gitweb.fluxo.info Git - utils-git.git/commitdiff
New mrconfig-updater
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Feb 2015 14:50:29 +0000 (11:50 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Feb 2015 14:50:29 +0000 (11:50 -0300)
mrconfig-updater [new file with mode: 0755]

diff --git a/mrconfig-updater b/mrconfig-updater
new file mode 100755 (executable)
index 0000000..c758aaa
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# Generates a `~/.custom/mrconfig-automatic` file with
+# autodetected repositories from some folders.
+#
+# To use this file, just add the following on your ~/.mrtrust:
+#
+#   custom/mrconfig-automatic
+#
+# and the following on your ~/.mrconfig:
+#
+#   include = cat ~/.custom/mrconfig-automatic
+#
+
+# Configuration
+MRCONFIG="$HOME/.custom/mrconfig-automatic"
+FOLDERS="apps file code"
+CWD="`pwd`"
+
+# Setup
+cd $HOME
+rm -f $MRCONFIG
+
+# Iterate
+for folder in $FOLDERS; do
+  find $folder -name '.git' | while read repo; do
+    echo "[`dirname $repo`]" >> $MRCONFIG
+  done
+done
+
+# Teardown
+cd $CWD