From a825a4ab6b572e25e03231598dd9723d8753a932 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 27 Feb 2015 11:50:29 -0300 Subject: New mrconfig-updater --- mrconfig-updater | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 mrconfig-updater (limited to 'mrconfig-updater') diff --git a/mrconfig-updater b/mrconfig-updater new file mode 100755 index 0000000..c758aaa --- /dev/null +++ b/mrconfig-updater @@ -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 -- cgit v1.2.3