@heyamiko/amiko-cli 0.4.8 → 0.4.10
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/dist/cli.js +8 -6
- package/package.json +1 -1
- package/src/cli.tsx +8 -4
package/dist/cli.js
CHANGED
|
@@ -61,12 +61,14 @@ function parseArgs(argv) {
|
|
|
61
61
|
return overrides;
|
|
62
62
|
}
|
|
63
63
|
async function main() {
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
// Ink's render-border.js calls box.top.repeat(contentWidth) where
|
|
65
|
+
// contentWidth = width - 2. When yoga computes a zero-width node (common
|
|
66
|
+
// in non-TTY / piped environments), contentWidth goes negative and
|
|
67
|
+
// String.repeat() throws. Patch String.repeat to clamp to 0.
|
|
68
|
+
const origRepeat = String.prototype.repeat;
|
|
69
|
+
String.prototype.repeat = function (count) {
|
|
70
|
+
return origRepeat.call(this, Math.max(0, Math.floor(count)));
|
|
71
|
+
};
|
|
70
72
|
const config = loadConfig();
|
|
71
73
|
const overrides = parseArgs(process.argv.slice(2));
|
|
72
74
|
const finalConfig = { ...config, ...overrides };
|
package/package.json
CHANGED
package/src/cli.tsx
CHANGED
|
@@ -77,10 +77,14 @@ function parseArgs(argv: string[]): ArgOverrides {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
async function main() {
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
// Ink's render-border.js calls box.top.repeat(contentWidth) where
|
|
81
|
+
// contentWidth = width - 2. When yoga computes a zero-width node (common
|
|
82
|
+
// in non-TTY / piped environments), contentWidth goes negative and
|
|
83
|
+
// String.repeat() throws. Patch String.repeat to clamp to 0.
|
|
84
|
+
const origRepeat = String.prototype.repeat;
|
|
85
|
+
String.prototype.repeat = function (count: number) {
|
|
86
|
+
return origRepeat.call(this, Math.max(0, Math.floor(count)));
|
|
87
|
+
};
|
|
84
88
|
|
|
85
89
|
const config = loadConfig();
|
|
86
90
|
const overrides = parseArgs(process.argv.slice(2));
|