mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2025-10-04 19:12:44 +02:00
FBT: Only format images in firmware, not ext apps
It was formatting demo screenshots too There might a better way to detect only icons, but not formatting also means less merge conflicts
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
- FBT:
|
||||
- OFW: Add `-Wundef` to compiler options (by @hedger)
|
||||
- OFW: Ensure that all images conform specification (by @skyhawkillusions & @hedger)
|
||||
- Don't format images in external apps folder, only firmware (by @Willy-JL)
|
||||
|
||||
### Updated:
|
||||
- Apps:
|
||||
|
@@ -326,6 +326,7 @@ firmware_env.Append(
|
||||
IMG_LINT_SOURCES=[
|
||||
# Image assets
|
||||
"applications",
|
||||
"!applications/external",
|
||||
"assets",
|
||||
],
|
||||
)
|
||||
|
@@ -57,10 +57,15 @@ class ImageLint(App):
|
||||
def _gather_images(self, folders):
|
||||
images = []
|
||||
for folder in folders:
|
||||
for dirpath, _, filenames in os.walk(folder):
|
||||
exclude = folder.startswith("!")
|
||||
for dirpath, _, filenames in os.walk(folder.removeprefix("!")):
|
||||
for filename in filenames:
|
||||
if self.is_file_an_icon(filename):
|
||||
images.append(os.path.join(dirpath, filename))
|
||||
filepath = os.path.join(dirpath, filename)
|
||||
if exclude:
|
||||
images.remove(filepath)
|
||||
else:
|
||||
images.append(filepath)
|
||||
return images
|
||||
|
||||
def is_file_an_icon(self, filename):
|
||||
|
Reference in New Issue
Block a user