blog/utils/config.sh
2023-09-02 20:22:34 -05:00

23 lines
449 B
Bash

#!/usr/bin/bash
PROJ_DIR=~/Blog
BLOG_DIR=$PROJ_DIR/blog
UTILS=$PROJ_DIR/utils
LIBS=$UTILS/libs
function include () {
local LIB_NAME="${1:?"include : a lib name was not provided"}"
[[ ! "$LIB_NAME" == *.sh ]] && LIB_NAME="$LIB_NAME.sh"
local LIB_PATH=""
if [[ ! -f $LIBS/$LIB_NAME ]]; then
echo "include : $LIBS/$LIB_NAME does not exist."
exit 1
else
LIB_PATH=$LIBS/$LIB_NAME
fi
. $LIB_PATH
}