RedMadRobot / figma-export

Command line utility to export colors, typography, icons and images from Figma to Xcode / Android Studio project
MIT License
718 stars 114 forks source link

Provide parameter to not delete the directory when exporting #190

Closed lichin-lin closed 1 year ago

lichin-lin commented 1 year ago

Sometime we got too many icons in one Figma Frame, so designer might split them into several Frames. That way, designer got flexibility to manage icons in different frames, developer also benefit from no need to wait too long on fetch the icons when using figma-export.

Currently, when run the export icons command, the script will clean up the whole directory first, then started to fetch icons. Thinking if user can provide a parameter that allow not to delete the directory, so the behavior will be append and replace. I think here is the part where the directly got deleted (ExportIcons.swift):

    if filter == nil {
        try? FileManager.default.removeItem(atPath: assetsURL.path)
    }

All the script commands should behave the same way like before, but we provide not to clean up logic. any chance we can make this behavior happen?

螢幕截圖 2022-09-20 上午9 57 04
subdan commented 1 year ago

Hello, @lichin-lin. To not to delete the directory just add * argument at the end of the command. E.g. figma-export icons -i ./figma-export.yaml "*"

subdan commented 1 year ago

@lichin-lin did the command above work for you?