forked from platformio/platformio-core
Fix lib update crashing when no libs are installed (resolve issue #19)
This commit is contained in:
1 parent
719e03da16
commit
9ead140b6e
3 files changed
+8
-2
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user