16 lines
373 B
TypeScript
16 lines
373 B
TypeScript
|
import { promisify } from "util";
|
||
|
import { execFile } from "child_process";
|
||
|
|
||
|
const execFilePromise = promisify(execFile);
|
||
|
|
||
|
export default function (cwd: string) {
|
||
|
return {
|
||
|
"shell.run": async (cmd: string, args: string[]) => {
|
||
|
let { stdout, stderr } = await execFilePromise(cmd, args, {
|
||
|
cwd: cwd,
|
||
|
});
|
||
|
return { stdout, stderr };
|
||
|
},
|
||
|
};
|
||
|
}
|