Fix lib update crashing when no libs are installed (resolve issue #19)

This commit is contained in:
Ivan Kravets committed 2014-10-05 23:34:40 +03:00
1 parent 719e03da16
commit 9ead140b6e
3 files changed
+8 -2

No files matched your search

+5 -2
View File
@@ -140,9 +140,12 @@ def lib_show(name):
@cli.command("update", short_help="Update installed libraries")
def lib_update():
lm = LibraryManager(get_lib_dir())
lib_names = lm.get_installed()
versions = get_api_result("/lib/version/" + ",".join(lib_names))
lib_names = lm.get_installed()
if not lib_names:
return
versions = get_api_result("/lib/version/" + ",".join(lib_names))
for name in lib_names:
info = lm.get_info(name)
+2
View File
@@ -33,6 +33,8 @@ class LibraryManager(object):
def get_installed(self):
items = []
if not isdir(self.lib_dir):
return items
for item in listdir(self.lib_dir):
conf_path = join(self.lib_dir, item, self.CONFIG_NAME)
if isfile(conf_path):