forked from NativeScript/nativescript-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.ts
28 lines (25 loc) · 841 Bytes
/
header.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { color, stripColors } from "../color";
export function printHeader() {
if (process.env.HIDE_HEADER) return;
const version = "8.5.3";
const middle = [
color.dim("│ "),
color.cyanBright.bold(" {N} NativeScript "),
color.whiteBright.bold("CLI"),
color.dim(` [v${version}] `),
color.dim(" │"),
].join("");
const middle2 = [
color.dim("│ "),
color.whiteBright.bold(" Empowering JS with Native APIs "),
color.dim(" │"),
].join("");
const end = [color.dim("─┘")].join("");
const width = stripColors(middle).length;
const endWidth = stripColors(end).length;
console.info(" ");
console.info(" " + color.dim("┌" + "─".repeat(width - 2) + "┐"));
console.info(" " + middle);
console.info(" " + middle2);
console.info(" " + color.dim("└" + "─".repeat(width - endWidth - 1)) + end);
}