aboutsummaryrefslogtreecommitdiffstats
path: root/dotfiles.py
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@tuxion.com> 2016-01-04 07:29:50 -0500
committerGravatar Jon Bernard <jbernard@tuxion.com> 2016-01-04 07:34:44 -0500
commitffb94ce64947566db7e1d1a144ebf63a450bf25e (patch)
tree7c960ac6105a27d7aa661f5418d53d07468eea79 /dotfiles.py
parent4b9b21b40f911e11dba5de9893d434f010f54c12 (diff)
downloaddotfiles-ffb94ce64947566db7e1d1a144ebf63a450bf25e.tar.gz
dotfiles-ffb94ce64947566db7e1d1a144ebf63a450bf25e.tar.bz2
dotfiles-ffb94ce64947566db7e1d1a144ebf63a450bf25e.zip
Clean up dotfile state function
Diffstat (limited to 'dotfiles.py')
-rw-r--r--dotfiles.py12
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):