cleanifix
Version:
Intelligent data cleaning CLI with natural language support - Docker-powered Python engine
48 lines • 1.36 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.spinner = spinner;
const ora_1 = __importDefault(require("ora"));
const chalk_1 = __importDefault(require("chalk"));
class NoOpSpinner {
text = '';
isSpinning = false;
start(text) {
if (text)
console.log(text);
}
stop() { }
succeed(text) {
if (text)
console.log(chalk_1.default.green('✓'), text);
}
fail(text) {
if (text)
console.log(chalk_1.default.red('✗'), text);
}
warn(text) {
if (text)
console.log(chalk_1.default.yellow('⚠'), text);
}
info(text) {
if (text)
console.log(chalk_1.default.blue('ℹ'), text);
}
}
function spinner() {
// Check if we're in a CI environment or non-TTY
const isCI = process.env.CI === 'true';
const isTTY = process.stdout.isTTY;
if (isCI || !isTTY) {
// Return a no-op spinner for CI environments
return new NoOpSpinner();
}
// Return the actual ora spinner for interactive terminals
return (0, ora_1.default)({
spinner: 'dots',
color: 'cyan'
});
}
//# sourceMappingURL=spinner.js.map