Skip to content

Commit

Permalink
Stopped generation of duplicate subst files in sn_mod_support_api rel…
Browse files Browse the repository at this point in the history
…eases.
  • Loading branch information
bvbohnen committed Jan 17, 2023
1 parent bebc66a commit 9f4931c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 9 additions & 2 deletions Support/Release_Spec_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class Release_Spec:
- Categories include: lua, python, ext_cat, subst_cat, documentation,
change_logs, misc, prior_subst_cat.
- Any files given to init will be treated as misc, and are not packed.
* ignore_existing_subst01
- Bool, True to ignore a existing subst01 cat/dat files, False (default)
to copy them to the output and place any new subst files in subst02.
* doc_specs
- Dict, keyed by relative path from root to the doc file name, holding
a list of files to include in the automated documentation generation,
Expand All @@ -63,6 +66,7 @@ def __init__(
files = None,
pack = True,
skip_subfolders = False,
ignore_existing_subst01 = False,
):
self.root_path = root_path.resolve()
self.name = self.root_path.name if not name else name
Expand All @@ -71,6 +75,7 @@ def __init__(
self.steam = steam
self.pack = pack
self.skip_subfolders = skip_subfolders
self.ignore_existing_subst01 = ignore_existing_subst01
if pack:
assert skip_subfolders == False

Expand Down Expand Up @@ -143,9 +148,11 @@ def Find_Ext_Files(self):
for path in (content_dir / 'ui').glob(f'**/*{suffix}'):
files['subst_cat'].append(path)

# Grab any existing subst file. Expect at most one.
# Grab any existing subst file. Expect at most one, possibly
# set to be ignored (since it will get regenerated by this
# release script).
subst_cat_path = content_dir / 'subst_01.cat'
if subst_cat_path.exists():
if subst_cat_path.exists() and not self.ignore_existing_subst01:
subst_dat_path = content_dir / 'subst_01.dat'
files['prior_subst_cat'].append(subst_cat_path)
files['prior_subst_cat'].append(subst_dat_path)
Expand Down
3 changes: 3 additions & 0 deletions Support/Release_Specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
Release_Spec(
root_path = project_dir / 'extensions/sn_mod_support_apis',
steam = True,
# Ignore subst01, which will be generated by this script and
# otherwise gets duplicate contents across two release runs.
ignore_existing_subst01 = True,
files = [
'lua_interface.txt',
],
Expand Down
2 changes: 1 addition & 1 deletion extensions/sn_mod_support_apis/md/Userdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
its copy, which ultimately gets saved back to uidata.xml.
Note: X4 is somewhat aggressive in deleting userdata that it thinks
is unused, which has occurred more than one during development of
is unused, which has occurred more than once during development of
this api.
As a safety, the copy of userdata in the player blackboard var will be
Expand Down

0 comments on commit 9f4931c

Please sign in to comment.