mrkmg/borgbackup-zsh-completion

Archive completion doesn't work with $BORG_REPO

Closed this issue · 3 comments

You check the README for "This is a Borg repository". It is not suitable for this scenario:

export BORG_REPO=borgrepo
borg list ::archive

I solved this by simply trusting borg for knowing if the directory is a repo 😄

if [[ -d "${cpath}" && -f "${cpath}/README" && "$(cat ${cpath}/README)" == "This is a Borg repository" ]]; then

mrkmg commented

From my testing, it does not appear that I can access ENV variables from withen the ZSH autocomplete function. I am still testing.

You have to export the variable, just setting it is not enough, autocompletion works in a subshell I think.

Closing, this is solved.