set env variables for Util.exec
parent
49f8d48cfd
commit
d464d3fa1c
|
@ -29,7 +29,7 @@ export default class Util {
|
||||||
let result: string;
|
let result: string;
|
||||||
// eslint-disable-next-line no-useless-catch
|
// eslint-disable-next-line no-useless-catch
|
||||||
try {
|
try {
|
||||||
const res = await ex(command);
|
const res = await ex(command, { env: { HOME: '/root' } });
|
||||||
result = res.stderr || res.stdout;
|
result = res.stderr || res.stdout;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return Promise.reject(new Error(`Command failed: ${err.cmd}\n${err.stderr || err.stdout}`));
|
return Promise.reject(new Error(`Command failed: ${err.cmd}\n${err.stderr || err.stdout}`));
|
||||||
|
|
Loading…
Reference in New Issue