diff options
Diffstat (limited to 'mrconfig-updater')
-rwxr-xr-x | mrconfig-updater | 32 |
1 files changed, 32 insertions, 0 deletions
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 |