From a04da147f8e170a64fcec425a77affb8f02424da Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Wed, 31 Jul 2013 20:38:06 -0400 Subject: Implement single-sync for specified files This commit allows the user to sync only one (or a subset) of the available dotfiles in the repository. --- dotfiles/core.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dotfiles/core.py b/dotfiles/core.py index 8ef0782..b2e2d0c 100644 --- a/dotfiles/core.py +++ b/dotfiles/core.py @@ -189,9 +189,14 @@ class Dotfiles(object): # unless a set of files is specified, operate on all files if not files: - files = self.dotfiles + dotfiles = self.dotfiles + else: + files = map(lambda x: os.path.join(self.homedir, x), files) + dotfiles = [x for x in self.dotfiles if x.name in files] + if not dotfiles: + raise Exception("file not found") - for dotfile in files: + for dotfile in dotfiles: dotfile.sync(force) def add(self, files): -- cgit v1.2.3