1
0
Fork 0

Remove env autoset

refactor/models
Bsian 2020-01-01 22:38:23 +00:00
parent 91c7b0c6f5
commit c9f49a5fce
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 1 additions and 2 deletions

View File

@ -27,13 +27,12 @@ export default class Util {
/**
* Executes a terminal command async.
* @param command The command to execute
* @param options childProcess.ExecOptions, the env option is automatically set if not provided.
* @param options childProcess.ExecOptions
*/
public async exec(command: string, options: childProcess.ExecOptions = {}): Promise<string> {
const ex = promisify(childProcess.exec);
let result: string;
try {
if (!options.env) options.env = { HOME: '/root' };
const res = await ex(command, options);
result = `${res.stdout}${res.stderr}`;
} catch (err) {