@flue/client 0.0.9 → 0.0.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/index.mjs +15 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -165,6 +165,13 @@ function transformEvent(raw) {
|
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region src/shell.ts
|
|
167
167
|
async function runShell(command, options) {
|
|
168
|
+
console.log("[flue] shell: running", {
|
|
169
|
+
command,
|
|
170
|
+
cwd: options?.cwd,
|
|
171
|
+
env: options?.env ? Object.keys(options.env) : void 0,
|
|
172
|
+
stdin: options?.stdin ? `${options.stdin.length} chars` : void 0,
|
|
173
|
+
timeout: options?.timeout
|
|
174
|
+
});
|
|
168
175
|
return new Promise((resolve) => {
|
|
169
176
|
const child = exec(command, {
|
|
170
177
|
cwd: options?.cwd,
|
|
@@ -175,11 +182,18 @@ async function runShell(command, options) {
|
|
|
175
182
|
timeout: options?.timeout
|
|
176
183
|
}, (error, stdout, stderr) => {
|
|
177
184
|
const rawCode = error && typeof error.code === "number" ? error.code : 0;
|
|
178
|
-
|
|
185
|
+
const result = {
|
|
179
186
|
stdout: stdout ?? "",
|
|
180
187
|
stderr: stderr ?? "",
|
|
181
188
|
exitCode: error ? rawCode || 1 : 0
|
|
189
|
+
};
|
|
190
|
+
console.log("[flue] shell: completed", {
|
|
191
|
+
command,
|
|
192
|
+
exitCode: result.exitCode,
|
|
193
|
+
stdout: result.stdout.length > 200 ? `${result.stdout.slice(0, 200)}... (${result.stdout.length} chars)` : result.stdout,
|
|
194
|
+
stderr: result.stderr.length > 200 ? `${result.stderr.slice(0, 200)}... (${result.stderr.length} chars)` : result.stderr
|
|
182
195
|
});
|
|
196
|
+
resolve(result);
|
|
183
197
|
});
|
|
184
198
|
if (options?.stdin) {
|
|
185
199
|
child.stdin?.write(options.stdin);
|