declapract
Version:
A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.
42 lines • 1.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const plan_1 = require("../../logic/commands/plan");
// eslint-disable-next-line import/no-default-export
class Plan extends core_1.Command {
async run() {
const { flags } = await this.parse(Plan);
const config = flags.config;
// generate the code
const configPath = config.slice(0, 1) === '/' ? config : `${process.cwd()}/${config}`; // if starts with /, consider it as an absolute path
await (0, plan_1.plan)({
usePracticesConfigPath: configPath,
filter: flags.practice || flags.file
? {
practiceNames: flags.practice ? [flags.practice] : undefined,
filePaths: flags.file ? [flags.file] : undefined,
}
: undefined,
});
}
}
Plan.description = 'plan and display what actions need to be taken in order to make a software project adhere to its declared practices.';
Plan.flags = {
help: core_1.Flags.help({ char: 'h' }),
config: core_1.Flags.string({
char: 'c',
description: 'path to the declapract usage config yml',
required: true,
default: 'declapract.use.yml',
}),
practice: core_1.Flags.string({
char: 'p',
description: 'the name of a specific practice you want to scope checking for',
}),
file: core_1.Flags.string({
char: 'f',
description: 'the file path of a specific file you want to scope checking for',
}),
};
exports.default = Plan;
//# sourceMappingURL=plan.js.map