Skip to content

Commit

Permalink
Sync: Fix home directory expansion.
Browse files Browse the repository at this point in the history
  • Loading branch information
sapegin committed Nov 28, 2012
1 parent 24d0b51 commit d2d6012
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sync.py
Expand Up @@ -10,7 +10,7 @@
import glob
import shutil

SOURCE_DIR = './dotfiles/tilde'
SOURCE_DIR = '~/dotfiles/tilde'
EXCLUDE = []
NO_DOT_PREFIX = []

Expand All @@ -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):
Expand Down

0 comments on commit d2d6012

Please sign in to comment.