eas-cli
Version:
EAS command line tool
24 lines (23 loc) • 613 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.logAsync = void 0;
const ora_1 = require("../../ora");
/**
* Log an asynchronous action using a spinner.
*/
async function logAsync(action, { hidden, ...message }) {
if (hidden) {
return await action();
}
const spinner = (0, ora_1.ora)(message.pending).start();
try {
const result = await action(spinner);
spinner.succeed(message.success);
return result;
}
catch (error) {
spinner.fail(message.failure);
throw error;
}
}
exports.logAsync = logAsync;
;