#!/bin/sh

export cl="$(cat <<'EOF'
     ,            _..._            ,
    {'.         .'     '.         .'}
   { ~ '.      _|=    __|_      .'  ~}
  { ~  ~ '-._ (___________) _.-'~  ~  }
 {~  ~  ~   ~.'           '. ~    ~    }
{  ~   ~  ~ /   /\     /\   \   ~    ~  }
{   ~   ~  /    __     __    \ ~   ~    }
 {   ~  /\/  -<( o)   ( o)>-  \/\ ~   ~}
  { ~   ;(      \/ .-. \/      );   ~ }
   { ~ ~\_  ()  ^ (   ) ^  ()  _/ ~  }
    '-._~ \   (`-._'-'_.-')   / ~_.-'
        '--\   `'._'"'_.'`   /--'
            \     \`-'/     /
             `\    '-'    /'
         jgs   `\       /'
                 '-...-'

EOF
)"

if [ $# -eq 2 && "$1" = "list" ]
then
	find -type d -exec sh -c 'echo {}/CLOWN.md' \;
fi


git status > /dev/null
if [ $? -ne 0 ]
then
	printf '%s\nBetter get to a git repository to deploy.\n' "$cl"
	exit 1
fi

find -type d -exec sh -c 'echo "$cl" > {}/CLOWN.md && git add {}/CLOWN.md' \;
git commit -m "A very important message"
printf '%s\nLocked and loaded cheif.\nFire at will.\n' "$cl"

