#!/bin/bash

PATH_ADDONS_REGULAR=${HOME}/source/addons,${HOME}/source/web/addons/
PATH_ADDONS_CUSTOM=${HOME}/source/custom/default/,${HOME}/source/custom/trial/,${HOME}/source/custom/private/,${HOME}/source/custom/test/
PATH_SERVER=${HOME}/source/server/

PATH_ADDONS=${PATH_ADDONS_REGULAR}

args=''
while  [[ $# > 0 ]]; do
    if [ $1 = "--custom" ]; then
        PATH_ADDONS=${PATH_ADDONS},${PATH_ADDONS_CUSTOM}
    else
        args="${args} $1"
    fi
    shift
done

${PATH_SERVER}/openerp-server ${args} --addons-path=${PATH_ADDONS} 

#./openerp-server --log-level=debug_rpc --addons-path=../addons/,../web/addons/ $*
