figma-export icon indicating copy to clipboard operation
figma-export copied to clipboard

Provide parameter to not delete the directory when exporting

Open lichin-lin opened this issue 2 years ago • 1 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

lichin-lin avatar Sep 20 '22 02:09 lichin-lin

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 avatar Sep 28 '22 17:09 subdan

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

subdan avatar Nov 13 '22 09:11 subdan