mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-07 02:30:38 +00:00
refactoring
This commit is contained in:
@@ -69,7 +69,7 @@ def install(opts, conf):
|
|||||||
diff=opts['installdiff'], quiet=opts['quiet'])
|
diff=opts['installdiff'], quiet=opts['quiet'])
|
||||||
installed = []
|
installed = []
|
||||||
for dotfile in dotfiles:
|
for dotfile in dotfiles:
|
||||||
if hasattr(dotfile, "link") and dotfile.link:
|
if hasattr(dotfile, 'link') and dotfile.link:
|
||||||
r = inst.link(dotfile.src, dotfile.dst)
|
r = inst.link(dotfile.src, dotfile.dst)
|
||||||
else:
|
else:
|
||||||
r = inst.install(t, opts['profile'], dotfile.src, dotfile.dst)
|
r = inst.install(t, opts['profile'], dotfile.src, dotfile.dst)
|
||||||
@@ -194,7 +194,7 @@ def header():
|
|||||||
LOG.log("")
|
LOG.log("")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def main():
|
||||||
ret = True
|
ret = True
|
||||||
args = docopt(USAGE, version=VERSION)
|
args = docopt(USAGE, version=VERSION)
|
||||||
conf = Cfg(args['--cfg'])
|
conf = Cfg(args['--cfg'])
|
||||||
@@ -237,7 +237,12 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
LOG.err('interrupted')
|
LOG.err('interrupted')
|
||||||
|
ret = False
|
||||||
|
|
||||||
if ret:
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
if main():
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user