28 lines
588 B
Bash
Executable file
28 lines
588 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
CONFIG_SUFFIX=".conf.yaml"
|
|
|
|
DOTBOT_DIR="dotbot"
|
|
DOTBOT_BIN="bin/dotbot"
|
|
|
|
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
cd "${BASEDIR}"
|
|
git submodule update --init --recursive "${DOTBOT_DIR}"
|
|
|
|
load_config() {
|
|
config="$1"
|
|
if [ -f "${config}" ]; then
|
|
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${config}"
|
|
else
|
|
echo "Skipping nonexistent file: ${config}"
|
|
fi
|
|
}
|
|
|
|
OS_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
|
|
|
|
for conf in default ${@} "${OS_NAME}"; do
|
|
load_config "${conf}${CONFIG_SUFFIX}"
|
|
done
|