You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've wanted to display my own logo (banner) in my project usage, yet it couldn't handle the "\"-characters properly.
Now I took the banner example from your Wiki and changed the previous logo with mine.
just removed const chalk = require('chalk') and replaced chalk.red( ... ) with header
code
The problem is - when I execute it:
green is a normal console.log() and normal is the one generated.
result
The banner is made with String.raw, so every "\" is replaced with "\\", that means it is written by eg. console.log(). Yet the libary does skip them anyway.
I brute forced a little bit and found out it takes 4 or in String.raw 2 (2*2) "\" to write one into the usage.
Maybe the formater refactors between strings and deletes some "\" or delets them by some replace functions?
EDIT:
Quick fix for users:
use Straing.raw methode as explained above and append .replaceAll("\\","\\\\") at the End.
The code you supplied in the zip file works correctly for me in both iTerm2 and Terminal on the mac, I think the issue is with your terminal.. Please try it in a few different terminals then let me know which terminals fail on which operating systems - thanks.
I've wanted to display my own logo (banner) in my project usage, yet it couldn't handle the "\"-characters properly.
Now I took the banner example from your Wiki and changed the previous logo with mine.
code
The problem is - when I execute it:
result
The banner is made with
String.raw
, so every "\" is replaced with "\\", that means it is written by eg.console.log().
Yet the libary does skip them anyway.I brute forced a little bit and found out it takes 4 or in String.raw 2 (2*2) "\" to write one into the usage.
Maybe the formater refactors between strings and deletes some "\" or delets them by some replace functions?
EDIT:
Hope I could help,
Jakabi
The text was updated successfully, but these errors were encountered: