blob: fd0bf7311cc2a19930af3ab6d6275e8c296773d6 [file] [log] [blame]
#!/bin/sh
# ====================================================================
# Copyright (c) 2014 Obeo
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Obeo - initial API and implementation
# ====================================================================
set -o nounset
set -o errexit
set -o errtrace
set -o functrace
shopt -s nullglob
shopt -s extglob
shopt -s expand_aliases
SCRIPT_PATH="$(dirname "${0}")"
INIT_PATH="${INIT_PATH:-${SCRIPT_PATH}/init}"
LS_LEVEL=20 # log level == info
# load bootstrap scripts (starting with _) in order
for S in $( echo "${INIT_PATH}/_"* | tr ' ' '\n' | sort -t '.' -k1n );
do
if [ ! -z "${DEBUG_BOOTSTRAP:-}" ]; then
echo "[DEBUG] Loading bootstrap '${S}'"
fi
source ${S}
done
# load scripts (not starting with _) in order
for S in $( ( echo "${INIT_PATH}/"* ; echo "${INIT_PATH}/_"*) | tr ' ' '\n' | sort -t '.' -k1n | uniq -u );
do
LSDEBUG "Loading '${S}'"
source ${S}
LSDEBUG "'${S}' has been loaded"
done