diff options
author | Jon Bernard <jbernard@tuxion.com> | 2016-01-04 07:29:50 -0500 |
---|---|---|
committer | Jon Bernard <jbernard@tuxion.com> | 2016-01-04 07:34:44 -0500 |
commit | ffb94ce64947566db7e1d1a144ebf63a450bf25e (patch) | |
tree | 7c960ac6105a27d7aa661f5418d53d07468eea79 | |
parent | 4b9b21b40f911e11dba5de9893d434f010f54c12 (diff) | |
download | dotfiles-ffb94ce64947566db7e1d1a144ebf63a450bf25e.tar.gz dotfiles-ffb94ce64947566db7e1d1a144ebf63a450bf25e.tar.bz2 dotfiles-ffb94ce64947566db7e1d1a144ebf63a450bf25e.zip |
Clean up dotfile state function
-rw-r--r-- | dotfiles.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/dotfiles.py b/dotfiles.py index 18d49aa..04b1394 100644 --- a/dotfiles.py +++ b/dotfiles.py @@ -60,21 +60,17 @@ class Dotfile(object): @property def state(self): - - # lets be optimistic - state = 'ok' - if self.target.check(exists=0): # only for testing, cli should never reach this state - state = 'error' + return 'error' elif self.name.check(exists=0): # no $HOME symlink - state = 'missing' + return 'missing' elif self.name.check(link=0) or not self.name.samefile(self.target): # if name exists but isn't a link to the target - state = 'conflict' + return 'conflict' - return state + return 'ok' def add(self): if self.target.check(exists=1): |