bldr 1.0.0

This commit is contained in:
2023-04-28 13:59:21 -04:00
parent 5f22f33d9c
commit ab928521f1
3 changed files with 111 additions and 4 deletions

View File

@@ -22,16 +22,27 @@ usage_small() {
load_config() {
if [ -f "/etc/bldr.conf" ]; then
source /etc/bldr.conf
elif [ -f "${HOME}/.config/bldr.conf"]; then
elif [ -f "${HOME}/.config/bldr.conf" ]; then
source ${HOME}/.config/bldr.conf
elif [ -f "$(pwd)/bldr.conf" ]; then
source $(pwd)/bldr.conf
else
printf "No valid bldr.conf found\n"
printf "Valid files are:\n"
printf "/etc/bldr.conf"
printf "${HOME}/.config/bldr.conf"
printf "$(pwd)/bldr.conf"
printf "/etc/bldr.conf\n"
printf "${HOME}/.config/bldr.conf\n"
printf "$(pwd)/bldr.conf\n"
exit 1
fi
}
check_for_toolchain() {
if [ -d "${TOOLCHAIN_PATH}" ]; then
printf "Toolchain found, adding to temporary PATH...\n"
PATH=${PATH}:${TOOLCHAIN_PATH}/bin
else
printf "Toolchain not found. Use the following command to download:\n"
printf "curl -O -J https://musl.cc/$(uname -m)-linux-musl-cross.tgz\n"
exit 1
fi
}
@@ -79,6 +90,10 @@ case $1 in
;;
-b|--build)
load_config "$@"
check_for_toolchain "$@"
if [ "$?" != 0 ]; then
exit 1
fi
shift
check_if_input_is_blank "$@"
mkdir /tmp/bldr-workspace