Added a check to make sure that a defined formula had a git URL to clone from

This commit is contained in:
Gregory Ballantine 2017-07-19 13:31:43 -04:00
parent 9b0c48a8e1
commit 766eaa21c3

View File

@ -51,7 +51,7 @@ def parse_formula_entry(formula, formulas_dir, formulas_url):
# check if the formula entry is a string or a dictionary
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