bldr 1.0.0
This commit is contained in:
23
tools/bldr
23
tools/bldr
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user