Skip to content

Conversation

fcastilloec
Copy link
Collaborator

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.

@@ -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) { %>
Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link
Collaborator Author

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.

@malept malept merged commit ab04829 into master Jul 8, 2020
@malept malept deleted the symbolic-icons branch July 8, 2020 01:54
@fcastilloec fcastilloec mentioned this pull request Jul 10, 2020
@fcastilloec fcastilloec mentioned this pull request Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants