Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

480 B
Raw Blame
export MB_DIR="{{mb-dir}}"
# the checkout you're in, else $MB_DIR:
_mage_root() {
    local root
    root=$(git rev-parse --show-toplevel 2>/dev/null)
    if [ -x "$root/bin/mage" ]; then echo "$root"; else echo "$MB_DIR"; fi
}
# alias:
mage() {
    "$(_mage_root)/bin/mage" "$@"
}
# autocomplete:
_bb_tasks() {
    COMPREPLY=( $(compgen -W "$(bb --config "$(_mage_root)/bb.edn" tasks |tail -n +3 |cut -f1 -d ' ')" -- ${COMP_WORDS[COMP_CWORD]}) );
}
complete -f -F _bb_tasks mage