Skip to content

Commit 032b5d7

Browse files
committed
fix: fix type error
1 parent 4ee5df6 commit 032b5d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import _ from 'lodash';
12
import { util, net } from 'appium/support';
23
import { promisify } from 'node:util';
34
import { exec } from 'node:child_process';
@@ -21,8 +22,12 @@ export async function shellExec(cmd, args = [], opts = {}) {
2122
timeoutMs = 60 * 1000 * 5
2223
} = opts;
2324
const fullCmd = util.quote([cmd, ...args]);
24-
return await B.resolve(execAsync(fullCmd, opts))
25+
const { stdout, stderr } = await B.resolve(execAsync(fullCmd, opts))
2526
.timeout(timeoutMs, `The command '${fullCmd}' timed out after ${timeoutMs}ms`);
27+
return {
28+
stdout: _.isString(stdout) ? stdout : stdout.toString(),
29+
stderr: _.isString(stderr) ? stderr : stderr.toString(),
30+
};
2631
}
2732

2833
/**

0 commit comments

Comments
 (0)