Permalink
Browse files

Make link.py work when invoked from another directory

  • Loading branch information...
1 parent 7229210 commit 64ada79b79efcaa19ed8182a509aee66328f0c0d @oyvindio committed May 2, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 link.py
View
@@ -11,9 +11,10 @@
'.git',]
if __name__ == '__main__':
- dotfiles = [f for f in os.listdir(os.path.dirname(__file__)) if f not in IGNORE_LIST]
+ dotfiles_fpath = os.path.dirname(os.path.abspath(__file__))
+ dotfiles = [f for f in os.listdir(dotfiles_fpath) if f not in IGNORE_LIST]
for dotfile in dotfiles:
- src = os.path.abspath(dotfile)
+ src = os.path.join(dotfiles_fpath, dotfile)
dest = os.path.join(os.path.expanduser('~'), os.path.basename(dotfile))
if dotfile == '.Xdefaults': # .Xdefaults should be linked as .Xdefaults-hostname
dest += '-{}'.format(platform.node())

0 comments on commit 64ada79

Please sign in to comment.