From 172f9aca67a66ee303c17f90a994cd52fc66552a Mon Sep 17 00:00:00 2001 From: raywu0123 Date: Sat, 23 Mar 2019 01:29:49 +0800 Subject: [PATCH] fix-xmas-underline Credit: @raywu0123 PR-URL: https://github.com/npm/cli/pull/179 Close: #179 Reviewed-by: @isaacs --- lib/xmas.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/xmas.js b/lib/xmas.js index 65c0c131abd48..81ab59c8e2236 100644 --- a/lib/xmas.js +++ b/lib/xmas.js @@ -11,7 +11,7 @@ module.exports = function (args, cb) { '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', '\u2E1B', '\u2042', '\u2E2E', '&', '@', '\uFF61' ] - var oc = [21, 33, 34, 35, 36, 37] + var oc = [33, 34, 35, 36, 37] var l = '\u005e' function w (s) { process.stderr.write(s) } @@ -25,6 +25,7 @@ module.exports = function (args, cb) { var O = L * 2 - 2 var S = (M - O) / 2 for (i = 0; i < S; i++) w(' ') + w(x + '\u001b[21m') w(x + '\u001b[32m' + f) for (i = 0; i < O; i++) { w( @@ -33,6 +34,7 @@ module.exports = function (args, cb) { ) } w(x + '\u001b[32m' + b + '\n') + w(x + '\u001b[0m') } w(' ') for (i = 1; i < H; i++) w('\u001b[32m' + l)