Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

self autocomplete doesn't respect ZDOTDIR env var when adding autocompletion for zsh #467

Open
m-rey opened this issue Sep 24, 2020 · 0 comments · May be fixed by #468
Open

self autocomplete doesn't respect ZDOTDIR env var when adding autocompletion for zsh #467

m-rey opened this issue Sep 24, 2020 · 0 comments · May be fixed by #468

Comments

@m-rey
Copy link

m-rey commented Sep 24, 2020

Short description

When running dephell self autocomplete, dephell adds the necessary line for auto-completion in $HOME/.zshrc:

rc_path = Path.home() / '.zshrc'

However, the path to the directory where the rc file is in, can be set by the environment variable ZDOTDIR. Therefore, the dephell self autocomplete should check first if the environment variable ZDOTDIR is set and valid and use it to find .zshrc and add the necessary line for auto-completion. If it is invalid or simply not set, the default path to $HOME/.zshrc can be used.

Steps to reproduce

$ zsh
$ mkdir "$HOME/not_default_zsh_dir"
$ touch "$HOME/not_default_zsh_dir/.zshrc"
$ export ZDOTDIR="$HOME/not_default_zsh_dir"
$ dephell self autocomplete

dephell has added the source ... auto-completion line to $HOME/.zshrc instead of $ZDOTDIR/.zshrc

Versions

WARNING cannot find config file 
{
  "cache": "0b",
  "path": "/usr/lib/python3.8/site-packages/dephell",
  "python": "/usr/bin/python3",
  "version": "0.8.3",
  "versions": {
    "dephell-archive": "0.1.6",
    "dephell-argparse": "0.1.2",
    "dephell-changelogs": "0.0.1",
    "dephell-discover": "0.2.10",
    "dephell-licenses": "0.1.6",
    "dephell-links": "0.1.5",
    "dephell-markers": "1.0.3",
    "dephell-pythons": "0.1.14",
    "dephell-setuptools": "0.2.3",
    "dephell-shells": "0.1.4",
    "dephell-specifier": "0.2.1",
    "dephell-venvs": "0.1.17",
    "dephell-versioning": "0.1.1"
  }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant