convert more execSync to async
This commit is contained in:
+3
-2
@@ -47,6 +47,7 @@ const apps = require('./apps.js'),
|
||||
safe = require('safetydance'),
|
||||
semver = require('semver'),
|
||||
settings = require('./settings.js'),
|
||||
shell = require('./shell.js'),
|
||||
superagent = require('superagent'),
|
||||
support = require('./support.js');
|
||||
|
||||
@@ -395,8 +396,8 @@ async function createTicket(info, auditSource) {
|
||||
|
||||
const logPaths = await apps.getLogPaths(info.app);
|
||||
for (const logPath of logPaths) {
|
||||
const logs = safe.child_process.execSync(`tail --lines=1000 ${logPath}`);
|
||||
if (logs) request.attach(path.basename(logPath), logs, path.basename(logPath));
|
||||
const [error, logs] = await safe(shell.promises.exec('createTicket', `tail --lines=1000 ${logPath}`, {}));
|
||||
if (!error && logs) request.attach(path.basename(logPath), logs, path.basename(logPath));
|
||||
}
|
||||
} else {
|
||||
request.send(info);
|
||||
|
||||
Reference in New Issue
Block a user