我在~/.virtualenvs
(我为$WORKON_HOME
变量定义的目录)下创建了许多 virtualenvwrapper 挂钩。
我通常喜欢将这样的系统文件置于版本控制之下——例如,我有一个高度自定义的 bash 配置文件~/Repos/dotfiles/bash_profile
,它符号链接到~/.bash_profile
.
但是,当我尝试将 virtualenvwrapper 钩子移动到下~/Repos/dotfiles/virtualenvwrapper_hooks/
,然后将它们符号链接回它们的原始文件名下~/.virtualenvs/
时,当我打开一个新的终端窗口时出现以下错误:
stevedore.extension error calling 'user_scripts': [Errno 62] Too many levels of symbolic links: '/Users/yiqing/.virtualenvs/postactivate'
stevedore.extension [Errno 62] Too many levels of symbolic links: '/Users/yiqing/.virtualenvs/postactivate'
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/stevedore/extension.py", line 137, in _invoke_one_plugin
response_callback(func(e, *args, **kwds))
File "/Library/Python/2.7/site-packages/virtualenvwrapper/hook_loader.py", line 185, in invoke
ext.plugin(args)
File "/Library/Python/2.7/site-packages/virtualenvwrapper/user_scripts.py", line 143, in initialize
make_hook(get_path('$VIRTUALENVWRAPPER_HOOK_DIR', filename), comment)
File "/Library/Python/2.7/site-packages/virtualenvwrapper/user_scripts.py", line 124, in make_hook
f = open(filename, 'w')
IOError: [Errno 62] Too many levels of symbolic links: '/Users/yiqing/.virtualenvs/postactivate'
符号链接整个目录 ( rm -rf ~/.virtualenvs ; ln -sF ...
) 也不起作用,因为当我尝试使用制表符完成命令时,它会返回:
NOTE: Virtual environments directory /Users/yiqing/.virtualenvs does not exist. Creating...
mkdir: /Users/yiqing/.virtualenvs: Input/output error
除了在 中创建 Git存储库~/.virtualenvs
之外,我想知道还有哪些其他选项可以将这些钩子置于版本控制之下?