How to define LittleFS partition, build image and flash it on ESP32?

So, I got a custom Python script to build my LittleFS partition image and I can upload it to the device using esptool, after all.
I’m still trying to figure out how to get PlatformIO to call the respective custom scripts, though, to build my image instead of a SPIFFS image when I select “Upload File System Image” and flash it to the device in the respective partition. Thoughts, anyone?