#!/bin/csh

setenv BIRCH_PROMPT "Y"

# Personal setting for prompt overrides all other settings.
if ( -e $HOME/.config/BIRCH/BIRCHsettings.source ) then
    set result=`grep 'BIRCH_PROMPT=N' $HOME/.config/BIRCH/BIRCHsettings.source`
    echo "result: "$result
    if ( "$result" != "" ) then
        setenv BIRCH_PROMPT "N"
    endif
endif

if ( "$BIRCH_PROMPT" == "Y" ) then
    echo "Looking for default endifles..."
    if ( -e $BIRCH/local/admin/set_birch_prompt_csh.source ) then
          # Local settings override default settings
        echo "Using local settings"
        source $BIRCH/local/admin/set_birch_prompt_csh.source
    else # default
        echo "Using default settings"
        source $BIRCH/admin/set_birch_prompt_csh.source
    endif
endif
