#!/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 #FOLDERS="apps file code .dotfiles" FOLDERS="apps file code" MRCONFIG="$HOME/.custom/mrconfig-automatic" DEPTH="2" CWD="`pwd`" # Setup cd $HOME rm -f $MRCONFIG # Iterate for folder in $FOLDERS; do if [ ! -d "$folder" ]; then continue fi # A trailing slash helps to find following symbolic links find $folder/ -maxdepth $DEPTH -name '.git' | while read repo; do echo "[`dirname $repo`]" >> $MRCONFIG done done # Teardown cd $CWD