-
Notifications
You must be signed in to change notification settings - Fork 47
feat: add symbolic icon support #169
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
Conversation
resources/spec.ejs
Outdated
@@ -22,7 +22,9 @@ mkdir -p %{buildroot}/usr/ | |||
/usr/lib/<%= name %>/ | |||
/usr/share/applications/<%= name %>.desktop | |||
/usr/share/doc/<%= name %>/ | |||
<% if (_.isObject(icon)) { %><% _.forEach(icon, function (path, resolution) { %>/usr/share/icons/hicolor/<%= resolution %>/apps/<%= name %>.<%= resolution === 'scalable' ? 'svg' : 'png' %> | |||
<% if (_.isObject(icon)) { %> | |||
<% _.forEach(icon, function (path, resolution) { %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this add extra whitespace to the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, it would add two empty lines. This doesn't affect the SPEC file from what I've seen. There's a tradeoff, we either make the spec file more readable (there are some conventions I've seen, like double spaces between sections, which we don't do), or we make our template more readable.
There's also the possibility of using newline slurping -%>
on the template. This should prevent both the if
and forEach
from creating empty lines, but lodash
throws a SyntaxError when trying to use them. They might be a feature of ejs
only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think we might need another PR to make the whole spec file a little more readable and insert double spaces between sections which is a convention. It always bothered me that and ending curly brackets are not in the same line as the statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it also adds a line with trailing whitespace (where the forEach
is), which is what I'm more worried about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figure out a way to deal with introducing empty lines. The code is still very readable.
By putting the closing tag on a new line, I'm able to better control readability and empty new lines. I'll use this technique in a new PR to make all .ejs
files more readable in the future.
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
d4705cd
to
0cc3b90
Compare
The latest version of
-common
introduced support for symbolic icons but this module needs additional configuration in order for it to work.-debian
doesn't require any additional configuration because icons are just copied and there's no need for a specs file.