@veecode-platform/safira-cli
Version:
Generate a microservice project from your spec.
99 lines (98 loc) • 4.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const listr2_1 = require("listr2");
const doctor_cmake_1 = require("../doctor/doctor-cmake");
const doctor_curl_1 = require("../doctor/doctor-curl");
const doctor_docker_1 = require("../doctor/doctor-docker");
const doctor_gpp_1 = require("../doctor/doctor-gpp");
const doctor_java_1 = require("../doctor/doctor-java");
const doctor_jq_1 = require("../doctor/doctor-jq");
const doctor_make_1 = require("../doctor/doctor-make");
const doctor_python_1 = require("../doctor/doctor-python");
const doctor_git_1 = require("../doctor/doctor-git");
class Doctor extends core_1.Command {
async run() {
const { flags } = await this.parse(Doctor);
const config = {
concurrent: true,
exitOnError: false,
};
if (flags.dev) {
const tasks = new listr2_1.Listr([
{
title: "Curl is healthy",
task: (ctx, task) => new doctor_curl_1.DoctorCurl().execute().then(result => task.title = result),
},
{
title: "Docker is healthy",
task: (ctx, task) => new doctor_docker_1.DoctorDocker().execute().then(result => task.title = result),
},
{
title: "G++ is healthy",
task: (ctx, task) => new doctor_gpp_1.DoctorGpp().execute().then(result => task.title = result),
},
{
title: "Java is healthy",
task: (ctx, task) => new doctor_java_1.DoctorJava().execute().then(result => task.title = result),
},
{
title: "JQ is healthy",
task: (ctx, task) => new doctor_jq_1.DoctorJq().execute().then(result => task.title = result),
},
{
title: "CMake is healthy",
task: (ctx, task) => new doctor_cmake_1.DoctorCMake().execute().then(result => task.title = result),
},
{
title: "Make is healthy",
task: (ctx, task) => new doctor_make_1.DoctorMake().execute().then(result => task.title = result),
},
{
title: "Git is healthy",
task: (ctx, task) => new doctor_git_1.DoctorGit().execute().then(result => task.title = result),
},
{
title: "Python is healthy",
task: (ctx, task) => new doctor_python_1.DoctorPython().execute().then(result => task.title = result),
},
{
title: "Git is healthy",
task: (ctx, task) => new doctor_git_1.DoctorGit().execute().then(result => task.title = result),
},
], config);
tasks.run();
}
else {
const tasks = new listr2_1.Listr([
{
title: "Curl is healthy",
task: (ctx, task) => new doctor_curl_1.DoctorCurl().execute().then(result => task.title = result),
},
{
title: "Docker is healthy",
task: (ctx, task) => new doctor_docker_1.DoctorDocker().execute().then(result => task.title = result),
},
{
title: "Java is healthy",
task: (ctx, task) => new doctor_java_1.DoctorJava().execute().then(result => task.title = result),
},
{
title: "Git is healthy",
task: (ctx, task) => new doctor_git_1.DoctorGit().execute().then(result => task.title = result),
},
], config);
tasks.run();
}
}
}
exports.default = Doctor;
Doctor.description = "Check the health of the dependencies";
Doctor.examples = [
"<%= config.bin %> <%= command.id %>",
];
Doctor.flags = {
dev: core_1.Flags.boolean({ char: "d" }),
file: core_1.Flags.string(),
};
Doctor.args = [];