-
Notifications
You must be signed in to change notification settings - Fork 11
Add echo about why files don't need to be minified #15
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
base: master
Are you sure you want to change the base?
Conversation
PeterDaveHello
left a comment
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.
This prompt is not good enough as it didn't tell the precise reason, there are two conditions.
minify.sh
Outdated
| elif [ $(wc -l "$filename.$filetype" | awk '{print $1}') -ge 15 ] || [ $(grep -E $'^(\t|\ )' "$filename.$filetype" | wc -l) -ge 5 ]; then | ||
| do_min=1 | ||
| else | ||
| echo.Yellow "$filename.$filetype is small enough, it don't need to be minified." |
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 don't -> it doesn't
|
Ping @maruilian11 |
|
How about |
|
There is no need to combine multi-line output in a single command here. |
|
Do you mean this? |
|
Yes. |
386357a to
49decd8
Compare
|
@PeterDaveHello I updated the commit. Please take a look. Thanks. |
minify.sh
Outdated
| else | ||
| echo.Red "$filename.$filetype is small enough, not be minified:" | ||
| echo.Yellow "It doesn't have more than 15 lines." | ||
| echo.Yellow "Or it doesn't have more than 5 lines with tab(s) or blank(s) in the head of sentences." |
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.
Or it doesn't have more than 5 lines with tab(s) or blank(s) ?
The condition here should be and not or ...
cd946ca to
74def9d
Compare
|
@PeterDaveHello Updated. |
PeterDaveHello
left a comment
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.
The wording/grammar looks very strange now, and what's the reason why to change its color? Shouldn't it be just yellow warning?
Explain the two conditions.
|
@PeterDaveHello Just updated. |
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.
Any possibility to improve the wording in warning to be more smooth?
maruilian11
left a comment
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.
How about this?
| do_min=1 | ||
| else | ||
| echo.Yellow "$filename.$filetype is small enough, not be minified:" | ||
| echo.Yellow "It doesn't have more than 15 lines." |
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's not over 15 lines.
| else | ||
| echo.Yellow "$filename.$filetype is small enough, not be minified:" | ||
| echo.Yellow "It doesn't have more than 15 lines." | ||
| echo.Yellow "Or it doesn't have more than 5 lines with tab(s) and blank(s) in the head of sentences." |
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.
Or it's not over 5 lines with tab(s) and blank(s) in the head of sentences.
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.
Could be the following reasons:
It doesn't have more than 15 lines.
It's not over 5 lines with tab(s) in the head of sentences.
It's not over 5 lines with blank(s) in the head of sentences.
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 prefer this one
Could be the following reasons:
It doesn't have more than 15 lines.
It's not over 5 lines with tab/blank(s) in the head of sentences.
PeterDaveHello
left a comment
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.
Should it be separated as multiple sentences?
PeterDaveHello
left a comment
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.
So what's the final version of the full message block? Confused here.
Sometimes the file won't get minified file after running the script, I think it's better to tell people the reason.
I use yellow echo to explain it.