Skip to content

Fix extra files in empty folders#25

Closed
strump wants to merge 1 commit intoorganicmapsfrom
fix-empty-folder-for-langs
Closed

Fix extra files in empty folders#25
strump wants to merge 1 commit intoorganicmapsfrom
fix-empty-folder-for-langs

Conversation

@strump
Copy link

@strump strump commented Dec 8, 2025

When Twine generates files it ignores empty folders for langs.

Comment on lines -143 to -145
lang = formatter.determine_language_given_path(str(item))
if not lang:
continue
Copy link
Author

@strump strump Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how old version checks if language should be update.
It iterates over folders and tries to infere language code from directory path.

Comment on lines +123 to +126
file_path = lang_path / file_name
if not file_path.exists() and not create_folders:
# Don't create file for 'lang'. Only update existing files.
continue
Copy link
Author

@strump strump Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now Twine checks actual file before generating language (if --create-folders flag disabled).

Signed-off-by: S. Kozyr <s.trump@gmail.com>
@strump strump force-pushed the fix-empty-folder-for-langs branch from 25426cf to aa71351 Compare December 8, 2025 07:58
@biodranik
Copy link
Member

As we discussed, there is no need to merge this change now, because the behavior in master branch is more flexible.

@strump strump closed this Dec 9, 2025
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.

2 participants