## Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
## SPDX-License-Identifier: BSD-3-Clause
##

## bashrc for the OpenMS/TOPP command shell ##

# check if this is a TOPP-shell or if the user included this file
if [ -n "$IS_TOPP_SHELL" ]; then
  ## we need the systems profile for the bash
  source /etc/profile 
  ## also add user profile; if it exists
  if [ -e ~/.profile ]; then
    source ~/.profile
  fi
fi

if [ -z  "${OPENMS_TOPP_PATH}" ]; then
  echo "ERROR: You need to set \${OPENMS_TOPP_PATH} to the folder where OpenMS was installed. E.g."
  echo "export OPENMS_TOPP_PATH=/Applications/OpenMS-1.10.0/"
  echo "source \${OPENMS_TOPP_PATH}/.TOPP_bash_profile"
else
  ## setting of the OpenMS data path to the share directory
  export OPENMS_DATA_PATH=${OPENMS_TOPP_PATH}/share/OpenMS

  ## add TOPPView, TOPPAS, and INIFileEditor to PATH
  export PATH=${OPENMS_TOPP_PATH}/TOPPView.app/Contents/MacOS/:${PATH}
  export PATH=${OPENMS_TOPP_PATH}/INIFileEditor.app/Contents/MacOS/:${PATH}
  export PATH=${OPENMS_TOPP_PATH}/TOPPAS.app/Contents/MacOS/:${PATH}
  ## also the search engines
  for folder in ${OPENMS_DATA_PATH}/THIRDPARTY/*/ ; do
    export PATH=$folder:$PATH
  done
  ## and finally the bin folder
  export PATH=${OPENMS_TOPP_PATH}/bin:${PATH}
fi

## EOF
