Closed sindresorhus closed 9 years ago
Hmm, that looks perfect to me...
Jay-kay. I'll play with it later today :+1:
can we use \n
as line break?
Any progress on this?
I just ran into that issue:
end: function () {
this.log(yosay(
chalk.red('That’s it!') + ' You’re all set to begin working with Bootstrap ✌(-‿-)✌\n' +
'Enter `grunt tasks` to see the available Grunt tasks.'
));
}
Which renders to:
_-----_
| | .--------------------------.
|--(o)--| | That’s it! You’re all |
`---------´ | set to begin working |
( _´U`_ ) | with Bootstrap ✌(-‿-)✌ |
/___A___\ '--------------------------'| |
| ~ | | Enter `grunt tasks` to |
__'.___.'__ | see the available Grunt |
´ ` |° ´ Y ` | tasks. |
'--------------------------'
I would love to use a line break within the end()
method of my Yeoman generator :kissing_heart:
This basically came down to... I couldn't solve the problem. I would be grateful if someone else could take a look.
The issue was that a new line went into the array as an empty string. The if statement thought it was at the end of the array because an empty string is falsy. So I explicitly check for undefined instead.