@nexex/cli
Version:
51 lines • 2.3 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const chalk_1 = __importDefault(require("chalk"));
const cli_table3_1 = __importDefault(require("cli-table3"));
const flat_1 = __importDefault(require("flat"));
const Base_1 = __importStar(require("../../Base"));
class ConfigList extends Base_1.default {
async run() {
const { flags } = this.parse(ConfigList);
const { config } = await this.readConfig();
const table = new cli_table3_1.default({
head: ['Key', 'Value']
});
for (const [k, v] of Object.entries(flat_1.default(config))) {
table.push([chalk_1.default.yellowBright(k), v]);
}
console.log(table.toString());
}
}
ConfigList.description = 'list all configs';
ConfigList.flags = {
...Base_1.default.flags
};
ConfigList.args = [{ name: 'file' }];
__decorate([
Base_1.initDir,
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", Promise)
], ConfigList.prototype, "run", null);
exports.default = ConfigList;
//# sourceMappingURL=list.js.map