@amplitude/ampli
Version:
Amplitude CLI
17 lines (16 loc) • 620 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const child_process_1 = require("child_process");
const DEFAULT_MAX_BUFFER_CONSOLE_OUTPUT = 5 * 1024 * 1024;
function execSyncToString(command, options) {
try {
return child_process_1.execSync(command, Object.assign({ encoding: 'utf-8', maxBuffer: DEFAULT_MAX_BUFFER_CONSOLE_OUTPUT }, options));
}
catch (e) {
if (e.code === 'ENOBUFS') {
throw new Error(`Error retrieving results for '${command}'. Response exceeded buffer size.`);
}
throw e;
}
}
exports.default = execSyncToString;