@synth1s/cloak 1.9.4 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/banner.js +6 -6
package/package.json
CHANGED
package/src/commands/banner.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
|
-
import { getActiveProfile } from '../lib/paths.js'
|
|
2
|
+
import { getActiveProfile, getAccountEmail } from '../lib/paths.js'
|
|
3
3
|
|
|
4
4
|
export function showBanner(columns) {
|
|
5
5
|
const name = getActiveProfile()
|
|
6
6
|
if (!name) return
|
|
7
7
|
|
|
8
8
|
const cols = columns || process.stderr.columns || process.stdout.columns || 80
|
|
9
|
-
const
|
|
9
|
+
const email = getAccountEmail(name)
|
|
10
|
+
const msg = email ? `cloak › ${name} — ${email}` : `cloak › ${name}`
|
|
10
11
|
const inner = cols - 2
|
|
11
12
|
const contentLen = msg.length + 2
|
|
12
13
|
const pad = Math.max(0, inner - contentLen)
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const bot = blue('╰' + '─'.repeat(inner) + '╯')
|
|
15
|
+
const top = '╭' + '─'.repeat(inner) + '╮'
|
|
16
|
+
const mid = '│ ' + chalk.bold(msg) + ' '.repeat(pad) + ' │'
|
|
17
|
+
const bot = '╰' + '─'.repeat(inner) + '╯'
|
|
18
18
|
|
|
19
19
|
process.stdout.write(top + '\n' + mid + '\n' + bot + '\n')
|
|
20
20
|
}
|