@gxp-dev/tools 2.0.46 → 2.0.48
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/gx-devtools.js +6 -3
- package/bin/lib/constants.js +1 -1
- package/package.json +1 -1
package/bin/gx-devtools.js
CHANGED
|
@@ -37,6 +37,9 @@ const isOneShot = ONE_SHOT_COMMANDS.includes(command) ||
|
|
|
37
37
|
// Check if we should use TUI with auto-start
|
|
38
38
|
const isTuiCommand = TUI_AUTO_START_COMMANDS.includes(command);
|
|
39
39
|
|
|
40
|
+
// --cli flag forces non-TUI mode regardless of TTY
|
|
41
|
+
const forceCliMode = args.includes('--cli');
|
|
42
|
+
|
|
40
43
|
// If no command or TUI command, try to launch TUI
|
|
41
44
|
// Fall back to traditional CLI if TUI dependencies are not available
|
|
42
45
|
if (!isOneShot) {
|
|
@@ -48,7 +51,7 @@ if (!isOneShot) {
|
|
|
48
51
|
// Check if we're in an interactive terminal (TTY); fall back to CLI if not
|
|
49
52
|
const isTTY = process.stdout.isTTY && process.stdin.isTTY;
|
|
50
53
|
|
|
51
|
-
if (fs.existsSync(tuiPath) && isTTY) {
|
|
54
|
+
if (fs.existsSync(tuiPath) && isTTY && !forceCliMode) {
|
|
52
55
|
// Use dynamic import() for ESM modules (ink v5 is ESM-only)
|
|
53
56
|
(async () => {
|
|
54
57
|
try {
|
|
@@ -81,8 +84,8 @@ if (!isOneShot) {
|
|
|
81
84
|
require("./lib/cli");
|
|
82
85
|
}
|
|
83
86
|
})();
|
|
84
|
-
} else if (!isTTY) {
|
|
85
|
-
// Non-interactive shell — skip TUI and run directly
|
|
87
|
+
} else if (!isTTY || forceCliMode) {
|
|
88
|
+
// Non-interactive shell or --cli flag — skip TUI and run directly
|
|
86
89
|
require("./lib/cli");
|
|
87
90
|
} else {
|
|
88
91
|
// TUI not compiled yet, use traditional CLI
|
package/bin/lib/constants.js
CHANGED