Files
bake/Bakefile
2022-04-26 12:56:52 +03:00

25 lines
719 B
Plaintext

install() { # Install bake: required prefix as argument
# Prefix is ~/.local/ or /usr/local/
# The executable is put under PREFIX/bin/ and should be in PATH
if [[ -z "$1" ]]; then
echo "Prefix required, e.g. ~/.local/ or /usr/local/"
exit 1
fi
bakepath="$1/bin/bake"
bakepath=${bakepath//\/\//\/}
mkdir -p "$prefix"/bin
cp -v bake "$bakepath"
chmod -v 755 "$bakepath"
if [[ ! "$( which bake )" = "$bakepath" ]]; then
echo "'bake' in path seems to be different than installed version. PATH finds: "
which bake
fi
echo "Add autocompletion:
echo \"if [[ -x $bakepath ]]; then . <( $bakepath __autocomplete__ ); fi\" >> ~/.bashrc
"
}