Add echo about why files don't need to be minified - #15
Conversation
PeterDaveHello
left a comment
There was a problem hiding this comment.
This prompt is not good enough as it didn't tell the precise reason, there are two conditions.
| 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." |
|
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. |
| 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.
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.
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. |
| do_min=1 | ||
| else | ||
| echo.Yellow "$filename.$filetype is small enough, not be minified:" | ||
| echo.Yellow "It doesn't have more than 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.
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.
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.
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.
Should it be separated as multiple sentences?
PeterDaveHello
left a comment
There was a problem hiding this comment.
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.