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

Improve build/image-optimization.sh #20586

Merged

Conversation

nickvergessen
Copy link
Member

  • Make it better readable
  • Don't break on spaces and quotes in file names
  • Allow to specify a root directory
  • Skip node_modules and tests

cc @ma12-co now you can run: ./image-optimization.sh ../apps/spreed/img/

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Comment on lines +40 to +48
scour --create-groups \
--enable-id-stripping \
--enable-comment-stripping \
--shorten-ids \
--remove-metadata \
--strip-xml-prolog \
--no-line-breaks \
-i $svg.opttmp \
-o $svg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One drawback of splitting it up into lines is that it is not possible anymore to easily copy-paste into the terminal and adjust the filename, which I often do if there’s only 1 new icon to optimize. So I’d prefer if this command stays on one line, but not a blocker. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you can copy/paste multi lines in terminal, what's the issue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try it? I thought so too, but at least in gnome-terminal it's a bit wonky when you try to edit anything but the last line.

If we can move the -i and -o parts on the same last line, it would work and still be readable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I did and looked very clean :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I'm fine either way!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well with the change I made you can also just specify the exact directory and it should only take a blink of your eye. If that is not enough we can also add a check for the provided path and run only on that one file if it matches a known pattern instead of being a directory

@rullzer rullzer mentioned this pull request Apr 21, 2020
55 tasks
@rullzer rullzer mentioned this pull request Apr 23, 2020
11 tasks
@nickvergessen
Copy link
Member Author

Moving to 20 as it is no priority and run mostly in master anyway

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let’s not have it lying around and just go for it, I’ll cope. ;)

@jancborchardt
Copy link
Member

@nickvergessen Drone is failing, otherwise all good! :)

@rullzer rullzer merged commit bd0a1b6 into master May 21, 2020
@rullzer rullzer deleted the techdebt/noid/make-image-optimization.sh-better-readable branch May 21, 2020 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants