Closed Helvethor closed 5 years ago
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
astrality/module.py | 3 | 97.38% | ||
<!-- | Total: | 3 | --> |
Totals | |
---|---|
Change from base Build 553: | -0.07% |
Covered Lines: | 4405 |
Relevant Lines: | 4500 |
In your particular setup, there is no need to perform a "double-symlink". You should only need to have an "init.vim" file in your modules directory. Then, you can symlink both ~/.vim/vimrc
and ~/.config/nvim/init.vim
directly to the modules/vim/.../init.vim
file without ever having to create a modules/vim/.../vimrc
file
I agree that this particular case is not very interesting. I have another case thought: I store many wallpapers in a directory and there is always one symlink called "wallpaper" pointing at my current favorite wallpaper file. One could argue that there is a better way to handle this other case, but somehow I feel like it would avoid headaches to others who happen to use symlink inside their dots.
@Helvethor I have tried replicating your original issue but cannot seem to get the same error.
I created a module test
which contains 2 files (a.txt
and b.txt
). a.txt
contains some text and b.txt
is a symlink to a.txt
.
.../astrality/modules/test
|
|-- a.txt
'-- b.txt -> a.txt
Then I perform a symlink for the b.txt
file as defined by the following modules.yml
file.
test:
on_startup:
symlink:
- content: b.txt
target: $HOME/test/b.txt
and it correctly creates a symlink b.txt
as follows in the $HOME/test
directory
$HOME/test
|
'-- b.txt -> .../astrality/modules/test/b.txt
It also works correctly upon subsequent re-runs of the astrality
command.
Let's discuss this further in the Gitter room so that we can have an easier conversation.
The difference between your setup and mine is that you define the action on a single file. My action was something like this:
stow:
content: 'modules/nvim/stow'
templates: 't\.(.+)'
target: '~/.config/nvim'
It seems like the file handling is not quite the same, although I have not investigated it further.
I had this case: a module (vim) containing two files (init.vim and vimrc), vimrc being a symlink -> init.vim. Uppon stow, \~/.vim/vimrc points to the correct file (modules/vim/.../vimrc). Uppon restow, the symlink action wouldn't recognize the link was already there because only the target part was being resolved (~/.vim/vimrc -> modules/vim/.../vimrc -> modules/vim/.../init.vim) and compared against the content (modueles/vim/.../vimrc). This produced an error on line 402 uppon re-symlinking.
I'm not sure this is the best solution and that it doesn't introduces new bugs.