From: Silvio Rhatto Date: Fri, 27 Feb 2015 14:50:29 +0000 (-0300) Subject: New mrconfig-updater X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=a825a4ab6b572e25e03231598dd9723d8753a932;p=utils-git.git New 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