Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to only output one icon? Also, is there a way to take multiple inputs? #847

Open
justingolden21 opened this issue Jun 1, 2022 · 2 comments
Labels
feature request New feature or request

Comments

@justingolden21
Copy link

justingolden21 commented Jun 1, 2022

Is your feature request related to a problem? Please describe.
I have multiple icons for pages in my PWA and want to generate one icon each.

Describe the solution you'd like
A CLI flag for one single icon. Currently --icon-only generates 3 icons. I have to delete each icon that I don't need before pushing.

Describe alternatives you've considered
Deleting the icons and making a very very long script in package.json.

Additional context
Currently, the command:
pwa-asset-generator static/img/pages/clock.svg static/img/pages/png --icon-only --opaque false takes in clock.svg and generates three icons. This is the smallest number I've got after trying nearly every combination of flags. Also, providing simply pwa-asset-generator static/img/pages/ as a path I was hoping it would read each file, or that I could provide a list of files, eg. .../clock.svg .../stopwatch.svg etc.

My command currently looks like:
pwa-asset-generator static/img/pages/clock.svg static/img/pages/png --icon-only --opaque false && pwa-asset-generator static/img/pages/worldclock.svg static/img/pages/png --icon-only --opaque false && pwa-asset-generator static/img/pages/stopwatch.svg static/img/pages/png --icon-only --opaque false and that's just for three pages, can't imagine if I had more. Also, I have to manually select the 6 unnecessary files and delete them. And of course there's a name conflict so it only generates the most recent icons.

So currently, for each page, I edit the script command, run it, copy the one file I need, rename the file, change the script command for the other file name, and so on until all icons are done. Very tedious human work.

Thanks in advance 😄

@justingolden21 justingolden21 added the feature request New feature or request label Jun 1, 2022
@onderceylan
Copy link
Collaborator

Hey @justingolden21, thanks for your feedback. It's not possible to generate only one icon at the moment.

That will be most likely possible with the next major version of the library which will provide flexibility for the images you need as an output.

Can you please share more details about your use case of using multiple inputs? That can also be considered in the redesign.

@justingolden21
Copy link
Author

Thanks for the reply and for considering that for future releases : )

I have a manifest and shortcuts for each item which contain icons. Those icons are currently SVGs and I like how pwa-asset-manager handles rendering svg icons dynamically and I already use it in my project, so I figured I would use it for this (fairly similar) purpose.

A few ideas for potential ways to input multiple files:

  • a file path and it checks for all images or images of a specific type in that folder
    (Could also match a regex)

  • a list of file paths (can be a lot of many files and long file path, but easiest to implement and understand)

  • a file path followed by list of file names inside that directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants