Skip to content

Create mod subdirs when merging#180

Merged
Pidgeot merged 1 commit intoPidgeot:masterfrom
pjf:pull/make_mod_subdirs
Sep 12, 2022
Merged

Create mod subdirs when merging#180
Pidgeot merged 1 commit intoPidgeot:masterfrom
pjf:pull/make_mod_subdirs

Conversation

@pjf
Copy link
Copy Markdown
Contributor

@pjf pjf commented Sep 11, 2022

Description

When walking the list of files to merge from a mod, also try to create any subdirectories those files may be in.

Testing

Used PyLNP to install the HighFantasty mod. Without this change, an error is logged that files cannot be copied. With this change, the files copy across fine, and the merged changes can be applied.

Launched a game with the merged changes applied. Created a world. Started a fortress mode game, and observed that HighFantasty civs like dark gnomes and lizardfolk were active in the world.

This doesn't mean that HighFantasy installs flawlessly (it doesn't), but it no longer errors out from failing to copy files.

Other information

Thank you so much for PyLNP! It rocks!!

Closes #173

@Pidgeot
Copy link
Copy Markdown
Owner

Pidgeot commented Sep 11, 2022

I haven't officially dropped Python 2 compatibility at this point, and it doesn't have exist_ok - so please follow the pattern seen elsewhere in the file:

if not os.path.isdir(mixed_dir):
    os.makedirs(mixed_dir)

Feel free to also add yourself to the contributor list in tkgui/tkgui.py.

@pjf
Copy link
Copy Markdown
Contributor Author

pjf commented Sep 12, 2022

I haven't officially dropped Python 2 compatibility at this point, and it doesn't have exist_ok - so please follow the pattern seen elsewhere in the file:

Shall do, even though the Python Software Foundation has asked that Python 2 lives on in our hearts and memories, but not our codebases.

Feel free to also add yourself to the contributor list in tkgui/tkgui.py.

When walking the list of files to merge from a mod, also try to create
any subdirectories those files may be in.

Closes Pidgeot#173
@pjf pjf force-pushed the pull/make_mod_subdirs branch from 0ac942c to 38cf56e Compare September 12, 2022 03:31
@pjf
Copy link
Copy Markdown
Contributor Author

pjf commented Sep 12, 2022

Requested changes made and branch updated. Thank you!!

@Pidgeot Pidgeot merged commit 1edbf5c into Pidgeot:master Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom subfolders aren't created when installing mods.

2 participants