aem-ext-daemon 0.3.4 → 0.3.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.
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* shell:exec runs a command and returns the full output.
|
|
6
6
|
*/
|
|
7
7
|
import type { DaemonConnection } from "../connection.js";
|
|
8
|
-
/** Run a shell command synchronously and return stdout. */
|
|
8
|
+
/** Run a shell command synchronously and return stdout + stderr. */
|
|
9
9
|
export declare function exec(command: string, cwd: string): string;
|
|
10
10
|
/** Check if AIO CLI is installed and return its version. */
|
|
11
11
|
export declare function checkAio(): string;
|
|
@@ -35,17 +35,27 @@ function getEnhancedEnv() {
|
|
|
35
35
|
PATH: `${extraPaths.join(":")}:${currentPath}`,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
/** Run a shell command synchronously and return stdout. */
|
|
38
|
+
/** Run a shell command synchronously and return stdout + stderr. */
|
|
39
39
|
export function exec(command, cwd) {
|
|
40
40
|
if (!command)
|
|
41
41
|
throw new Error("command is required");
|
|
42
|
-
|
|
42
|
+
// Redirect stderr to stdout so we capture everything, and ensure
|
|
43
|
+
// no interactive prompts leak to the daemon terminal.
|
|
44
|
+
// Also set CI=true and TERM=dumb so CLIs skip interactive prompts.
|
|
45
|
+
const wrappedCommand = `${command} 2>&1`;
|
|
46
|
+
const result = execSync(wrappedCommand, {
|
|
43
47
|
cwd,
|
|
44
48
|
timeout: EXEC_TIMEOUT,
|
|
45
49
|
maxBuffer: MAX_BUFFER,
|
|
46
50
|
encoding: "utf-8",
|
|
47
51
|
shell: getUserShell(),
|
|
48
|
-
env:
|
|
52
|
+
env: {
|
|
53
|
+
...getEnhancedEnv(),
|
|
54
|
+
CI: "true",
|
|
55
|
+
TERM: "dumb",
|
|
56
|
+
NO_COLOR: "1",
|
|
57
|
+
},
|
|
58
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
49
59
|
});
|
|
50
60
|
return result;
|
|
51
61
|
}
|