Fix the setup script, now it will properly set up get repository heads.

This commit is contained in:
Relintai 2019-12-03 19:30:12 +01:00
parent b58f5093da
commit 52ad92047a
1 changed files with 5 additions and 3 deletions

View File

@ -37,11 +37,13 @@ third_party_addon_repositories = [
target_commits = {} target_commits = {}
def load_target_commits_array(): def load_target_commits_array():
global target_commits
if os.path.isfile('./HEADS'): if os.path.isfile('./HEADS'):
with open('./HEADS', 'r') as infile: with open('./HEADS', 'r') as infile:
target_commits = json.load(infile) target_commits = json.load(infile)
else: else:
target_commits = [] target_commits = {}
def save_target_commits_array(): def save_target_commits_array():
with open('./HEADS', 'w') as outfile: with open('./HEADS', 'w') as outfile:
@ -160,8 +162,6 @@ def setup_addons_third_party_addons():
copy_addon_repository(rep, './game/addons/', '.' + module_clone_path) copy_addon_repository(rep, './game/addons/', '.' + module_clone_path)
def setup_all(): def setup_all():
load_target_commits_array()
setup_engine() setup_engine()
setup_modules() setup_modules()
setup_addons() setup_addons()
@ -179,6 +179,8 @@ opts.Add(EnumVariable('repository_type', 'Type of repositories to clone from fir
opts.Update(env) opts.Update(env)
Help(opts.GenerateHelpText(env)) Help(opts.GenerateHelpText(env))
load_target_commits_array()
rt = env['repository_type'] rt = env['repository_type']
if rt == 'ssh': if rt == 'ssh':