rucker / dotfiles-manager

A script to compile your dotfiles!
MIT License
8 stars 0 forks source link

[dfm.py][Windows] sys.path includes un-dereferenced symlink when dfm.py called via symlink #55

Closed rucker closed 2 years ago

rucker commented 2 years ago

Running dfm via a simlink on $PATH results in the error:

Traceback (most recent call last):
  File "C:/Users/rick/bin/dfm", line 12, in <module>
    from env import env
ModuleNotFoundError: No module named 'env'

To reproduce under git-bash on Windows:

  1. add print(sys.path) to top of dfm.py
  2. $ ln -s ~/repos/dotfiles-manager/dotfiles/dfm.py ~/bin/dfm && dfm Observe the output is prepended with 'C:\\Users\\rick\\bin'

On macOS, the output is prepended with the dereferenced path '/Users/rick/repos/dotfiles-manager/dotfilesmanager' and the ModuleNotFoundError does not occur.