Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
runAsync: _asyncToGenerator(function* (env) {
var argv = env.argv;
var args = argv._;
yield pm2serve.setupServeAsync(env);
var pm2Id = yield config.expInfoFile.getAsync('pm2Id', null);
if (!pm2Id) {
throw CommandError('NO_PM2_ID', env, "I can't find a server; try running `exp start` first.");
}
var lines = argv.lines || 50;
log("Use Ctrl-C to stop streaming logs");
yield pm2.promise.connect();
pm2.streamLogs(pm2Id, lines, !!argv.raw);
})
};
}, function() {
pm2.streamLogs('all', 0);
});
});
async function action(projectDir, options) {
await pm2serve.setupServeAsync(projectDir);
var pm2Id = await config.projectExpJsonFile(projectDir).getAsync('pm2Id', null);
if (pm2Id == null) {
throw CommandError('NO_PM2_ID', "I can't find a server; try running `exp start` first.");
}
var lines = options.lines || 50;
log("Use Ctrl-C to stop streaming logs");
await pm2.promise.connect();
pm2.streamLogs(pm2Id, lines, !!options.raw);
}