From d2d60120f820252bc1fde07bed80ee8cde94444b Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Wed, 28 Nov 2012 12:51:21 +0400 Subject: [PATCH] Sync: Fix home directory expansion. --- sync.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sync.py b/sync.py index 0af5892..12ee79f 100755 --- a/sync.py +++ b/sync.py @@ -10,7 +10,7 @@ import os import glob import shutil -SOURCE_DIR = './dotfiles/tilde' +SOURCE_DIR = '~/dotfiles/tilde' EXCLUDE = [] NO_DOT_PREFIX = [] @@ -29,13 +29,13 @@ def is_link_to(link, dest): def main(): - os.chdir(SOURCE_DIR) + os.chdir(os.path.expanduser(SOURCE_DIR)) for filename in [file for file in glob.glob('*') if file not in EXCLUDE]: dotfile = filename if filename not in NO_DOT_PREFIX: dotfile = '.' + dotfile dotfile = os.path.join(os.path.expanduser('~'), os.path.splitext(dotfile)[0]) - source = os.path.join(SOURCE_DIR, filename) + source = os.path.join(SOURCE_DIR, filename).replace('~', '.') # Check that we aren't overwriting anything if os.path.lexists(dotfile):