fluxy-bot 0.5.59 → 0.5.60
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/bin/cli.js +15 -9
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -167,16 +167,22 @@ function chooseTunnelMode() {
|
|
|
167
167
|
];
|
|
168
168
|
|
|
169
169
|
let selected = 0;
|
|
170
|
+
let lineCount = 0;
|
|
171
|
+
|
|
172
|
+
function writeLine(text = '') {
|
|
173
|
+
process.stdout.write(`\x1b[2K${text}\n`);
|
|
174
|
+
lineCount++;
|
|
175
|
+
}
|
|
170
176
|
|
|
171
177
|
function render() {
|
|
172
|
-
// Move cursor up to
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
process.stdout.write(`\x1b[${totalLines}A`);
|
|
178
|
+
// Move cursor up to overwrite previous render
|
|
179
|
+
if (lineCount > 0) {
|
|
180
|
+
process.stdout.write(`\x1b[${lineCount}A`);
|
|
176
181
|
}
|
|
177
|
-
|
|
182
|
+
lineCount = 0;
|
|
178
183
|
|
|
179
|
-
|
|
184
|
+
writeLine(` ${c.bold}${c.white}How do you want to connect your bot?${c.reset}`);
|
|
185
|
+
writeLine();
|
|
180
186
|
|
|
181
187
|
for (let i = 0; i < options.length; i++) {
|
|
182
188
|
const opt = options[i];
|
|
@@ -185,11 +191,11 @@ function chooseTunnelMode() {
|
|
|
185
191
|
const label = isSelected ? `${c.bold}${c.white}${opt.label}` : `${c.dim}${opt.label}`;
|
|
186
192
|
const tag = `${opt.tagColor}[${opt.tag}]${c.reset}`;
|
|
187
193
|
|
|
188
|
-
|
|
194
|
+
writeLine(` ${bullet} ${label}${c.reset} ${tag}`);
|
|
189
195
|
for (const line of opt.desc) {
|
|
190
|
-
|
|
196
|
+
writeLine(` ${c.dim}${line}${c.reset}`);
|
|
191
197
|
}
|
|
192
|
-
if (i < options.length - 1)
|
|
198
|
+
if (i < options.length - 1) writeLine();
|
|
193
199
|
}
|
|
194
200
|
}
|
|
195
201
|
|