Closed tomasz13nocon closed 1 year ago
Dotdrop will do the following to the argument of --as
on import:
~
to the user home directory if present)This means that:
--as test
would be first transformed to <current-directory>/test
. This is what you see with your first example with the path first transformed to /home/user/my_dotpath/my_dotfiles/test
(current directory prepended) and then copied to the dotpath under /home/user/my_dotfiles/my_dotpath/my_dotfiles/test
--as ~/test
would be transformed first to /home/user/test
and then copied to the dotpath to /home/user/my_dotfiles/my_dotpath/test
What --as
provides is a way to import a dotfile but pretend it is a different file. Here is the initial issue for this feature: https://github.com/deadc0de6/dotdrop/issues/220.
I will complete the doc and better detail its usage and how its argument is handled, thanks for pointing that out.
Doc is updated: https://dotdrop.readthedocs.io/en/latest/usage/#import-dotfiles. Hopefully it is clearer now.
Dotdrop version: v1.11
Describe the bug
It's not clear from the documentation how
--as
is supposed to interpret its argument.dotdrop import -d ~/.config/nvim --as test
results in:[DRY] would copy /home/user/.config/nvim to /home/user/my_dotfiles/my_dotpath/my_dotfiles/test
and using the example from the documentation:dotdrop import -d ~/.config/nvim --as ~/test
[DRY] would copy /home/user/.config/nvim to /home/user/my_dotfiles/my_dotpath/test
The tilde seems to mean the dotpath instead of home directory, which is confusing. And using
--as
without the tilde just acts weird, creating another dotfiles directory inside dotpath.I had a look at the
import-as.sh
bash test, and it only tests usage with the tilde.Steps to Reproduce
mkdir ~/my_dotfiles
my_dotpath
Expected behavior
It would be good to mention in the documentation that
--as
is supposed to be used with tilde (as without it, the behavior is unexpected), and that the tilde means dotpath, not home.Alternatively to make it more intuitive, don't use the tilde and interpret the argument as a path relative to the dotpath, so that
--as some/path
would resultmy_dotfiles/my_dotpath/some/path