Browse Source

Allow installing purely local mods from ~/git such as for testing.

master
Poikilos 2 days ago
parent
commit
bea574d746
  1. 22
      pyenliven/gamebuilder.py

22
pyenliven/gamebuilder.py

@ -99,17 +99,21 @@ class GameBuilder:
f"stopgap={stopgap} but there is no {stopgap_src}") f"stopgap={stopgap} but there is no {stopgap_src}")
# 2. Git clone if we have repo URL(s) # 2. Git clone if we have repo URL(s)
if not url: urls = None
raise ValueError(f"Missing 'repo' for {entry}") if url:
urls = [url] if isinstance(url, str) else url urls = [url] if isinstance(url, str) else url
url = urls[-1] # prefer last one url = urls[-1] # prefer last one
del urls del urls
user = entry.get('distributor') user = entry.get('distributor')
if not user: if not user:
user = url.split("/")[-2] user = url.split("/")[-2]
repo_name = url.split("/")[-1].replace(".git", "") repo_name = url.split("/")[-1].replace(".git", "")
else:
repo_name = name
source_path = os.path.expanduser(f"~/git/{repo_name}") source_path = os.path.expanduser(f"~/git/{repo_name}")
if not url and not os.path.isdir(source_path):
raise ValueError(f"Missing 'repo' for {entry}")
symlink = False symlink = False
if os.path.isdir(source_path): if os.path.isdir(source_path):
# Use the development copy on the computer # Use the development copy on the computer

Loading…
Cancel
Save