#!bash
# As you can see, this is not really the bashrc, it's just an installer
# Back in the day, this also used to be the download location of the real file
#
# More information is available here: https://github.com/dotcomfy/dotcomfy-bashrc

doinstall(){
  local local_rcfile
  local tmpfile=${TMPDIR:-/tmp}/bashrcupd.${LOGNAME:-user}.$$
  curl -s -S https://raw.githubusercontent.com/dotcomfy/dotcomfy-bashrc/master/bashrc > $tmpfile
  if [ -n "$BASH_SOURCE" ] && [ -f $BASH_SOURCE ] ; then
    local_rcfile=$BASH_SOURCE
  else
    local_rcfile=~/.bashrc
  fi

  echo "Saved as $tmpfile: $(wc -l $tmpfile | awk '{print $1}') lines"
  mv $tmpfile $local_rcfile
  echo "Installed as $local_rcfile"
  . $local_rcfile
}

doinstall
