RedMadRobot / figma-export

Command line utility to export colors, typography, icons and images from Figma to Xcode / Android Studio project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide parameter to not delete the directory when exporting

lichin-lin opened this issue · comments

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

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 "*"

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