alias cbr='cargo b -r -q'
export PATH="$PWD/target/release:$PATH"
DIR_NAME=$(basename "$PWD")





mysh() {
    ps -p $$ -o comm= | awk -F/ '{print $NF}' | sed 's/^-//'
}


if ! command -v fdf &> /dev/null ; then
    if cbr; then
        echo "Built fdf successfully"
    else
        echo "Failed to build fdf" >&2
    fi
fi

if command -v fdf >/dev/null 2>&1; then
    eval "$(fdf --generate $(mysh))" >/dev/null 2>&1

fi

alias REBUILDCOMPLETIONS="cbr && cd .. && cd $DIR_NAME"


if ! command -v pre-commit &> /dev/null; then
    echo "Warning: pre-commit is not installed. Please install it via: https://pre-commit.com/" >&2
else
    pre-commit install > /dev/null 2>&1
fi
