Files
rcz/src/index.ts

46 lines
1.2 KiB
JavaScript

#!/usr/bin/env node
/*
Copyright 2024 Resultium LLC
This file is part of RCZ.
RCZ is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
RCZ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RCZ. If not, see <https://www.gnu.org/licenses/>.
*/
import { Command } from "commander";
import { readdir } from "fs/promises";
import { join } from "path";
(async () => {
const program = new Command();
program
.name("rcz")
.description("Resultium commit standardization command-line interface")
.version("1.13.1");
const commandFiles = await readdir(join(__dirname, "commands"));
for (const commandFile of commandFiles) {
const command = (
await import(join(__dirname, "commands", commandFile.split(".")[0]))
).default;
program.addCommand(command);
}
program.parse();
})();