-
Notifications
You must be signed in to change notification settings - Fork 0
/
loader.sh
45 lines (36 loc) · 1.22 KB
/
loader.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
################################################################################
# Bashor Framework
#
# LICENSE:
# This software is released under the GNU Lesser General Public License version 3
# http://www.gnu.org/licenses/lgpl-3.0.txt
#
# Copyright 2010-2013 the bashor project authors. All rights reserved.
################################################################################
BASHOR_PATH=`echo "$BASH_SOURCE" | sed 's#/\?[^/]*$##' | sed 's#^./##'`
if [[ ! "$BASHOR_PATH" =~ ^/ ]]; then
BASHOR_PATH=`echo "$PWD/$BASHOR_PATH" | sed 's#/\.\?$##'`
fi
# Set paths
BASHOR_PATH_INCLUDES="${BASHOR_PATH}/include"
BASHOR_PATH_CLASSES="${BASHOR_PATH}/lib"
BASHOR_PATHS_CLASS="${BASHOR_PATH_CLASSES}"
# Add Constants
. "${BASHOR_PATH_INCLUDES}/constant.sh"
# Defaults
NL=$'\n'
[ -z "BASHOR_LOG_FILE" ] && BASHOR_LOG_FILE="./error.log"
BASHOR_BACKTRACE_REMOVE=0;
[ -n "$PS1" ] && BASHOR_INTERACTIVE=1
# Load Config
. "${BASHOR_PATH_INCLUDES}/config.sh"
[ -n "$BASHOR_PATH_CONFIG" ] && . "$BASHOR_PATH_CONFIG"
# Add debuging channel
exec 3>&2
# Load functions
. "${BASHOR_PATH_INCLUDES}/function.sh"
if [ -n "$BASHOR_ERROR_CLASS" ]; then
loadClassOnce Bashor_ErrorHandler
class Bashor_ErrorHandler setHandler
fi