toaruos/util/prompt.sh

19 lines
480 B
Bash
Raw Normal View History

2018-03-21 11:17:48 +03:00
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2018-07-19 03:32:25 +03:00
if ! $DIR/check-reqs.sh >&2; then
echo "A toolchain is not available and the above issues were found." >&2
echo "Resolve the problems above and run \`make\` again." >&2
echo -n "n" && exit 1
fi
2018-03-21 11:17:48 +03:00
echo -n "Toolchain has not been built. Would you like to build it now? (y/n) " >&2
read response
case $response in
[yY]) bash $DIR/build-gcc.sh >&2 ;;
[nN]) echo -n "n" && exit 1 ;;
*)
esac