Skip to content

Commit

Permalink
Merge pull request #38 from cfengine/index_key
Browse files Browse the repository at this point in the history
Changed the key from modules to index
  • Loading branch information
olehermanse authored Oct 26, 2021
2 parents af3c248 + 63934eb commit de7e224
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cfbs/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Index:
def __init__(self, path):
self.path = path
if not self.path:
self.path = "https://raw.githubusercontent.com/cfengine/cfbs-index/master/index.json"
self.path = "https://raw.githubusercontent.com/cfengine/cfbs-index/master/cfbs.json"
self._data = None

def __contains__(self, key):
Expand All @@ -96,7 +96,7 @@ def _get(self) -> dict:
index = read_json(path)
if not index:
sys.exit("Could not download or find module index")
if "modules" not in index:
if "index" not in index:
sys.exit("Empty or invalid module index")
return index

Expand All @@ -106,7 +106,7 @@ def get(self) -> dict:
return self._data

def get_modules(self) -> dict:
return self.get()["modules"]
return self.get()["index"]

def exists(self, module):
return os.path.exists(module) or (module in self)
Expand Down

0 comments on commit de7e224

Please sign in to comment.