bash completion not working properly when adding PATH="${PATH}:~/.local/bin"

Following error happens when adding PATH="${PATH}:~/.local/bin",

bst env: ‘bst’: No such file or directory

This issue dont happen if we use PATH="{PATH}:{HOME}/.local/bin"

steps to reproduce

  1. open ~/.bashrc in vi
  2. add export PATH="${PATH}:~/.local/bin"
  3. add source "${HOME}/Devel/buildstream/buildstream/data/bst"
  4. exit current shell.
  5. start new shell so that your ~/.bashrc changes will take effect
  6. type bst, press spacebar and press tab. you will get above mentioned error

I have attached fix which dont break bash completion even if user add ~/.local/bin instead of ${HOME}/.local/bin into $PATH variable fix-completion.patch