Added a check to make sure that a defined formula had a git URL to clone from
This commit is contained in:
parent
9b0c48a8e1
commit
766eaa21c3
@ -49,9 +49,9 @@ def parse_formula_entry(formula, formulas_dir, formulas_url):
|
||||
local_path = ''
|
||||
|
||||
# check if the formula entry is a string or a dictionary
|
||||
if isinstance(formula, dict):
|
||||
if isinstance(formula, dict):
|
||||
# entry is a dictionary
|
||||
git_url = str(formula['url'])
|
||||
git_url = str(formula.get('url', formulas_url)) # get the 'url' value if it is defined, otherwise use the default
|
||||
local_path = str(formulas_dir) + '/' + str(formula['name'])
|
||||
elif isinstance(formula, str):
|
||||
# entry is a string
|
||||
@ -59,7 +59,7 @@ def parse_formula_entry(formula, formulas_dir, formulas_url):
|
||||
local_path = str(formulas_dir) + '/' + str(formula) + '-formula'
|
||||
else:
|
||||
# entry type is not supported
|
||||
print('One of your entries is not a dict or a string (' + str(formula) + ') - please fix this.')
|
||||
print('One of your formula entries is not a dict or a string (' + str(formula) + ') - please fix this.')
|
||||
sys.exit(1)
|
||||
|
||||
# return the values here
|
||||
|
Loading…
Reference in New Issue
Block a user