@kody-ade/kody-engine 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.mjs +22 -0
- package/dist/bin/cli.mjs.map +1 -1
- package/package.json +1 -1
package/dist/bin/cli.mjs
CHANGED
|
@@ -10595,6 +10595,15 @@ function initCommand(opts) {
|
|
|
10595
10595
|
fs37.copyFileSync(workflowSrc, workflowDest);
|
|
10596
10596
|
console.log("\u2713 Copied .github/workflows/kody.yml");
|
|
10597
10597
|
}
|
|
10598
|
+
if (opts.workflowOnly) {
|
|
10599
|
+
console.log("\nDone! Configure secrets in your GitHub repo settings.");
|
|
10600
|
+
return;
|
|
10601
|
+
}
|
|
10602
|
+
if (fs37.existsSync(opencodeDir)) {
|
|
10603
|
+
const destOpencode = path36.join(cwd, ".opencode");
|
|
10604
|
+
copyDirRecursive(opencodeDir, destOpencode, opts.force);
|
|
10605
|
+
console.log("\u2713 Copied .opencode/ (agents + docs)");
|
|
10606
|
+
}
|
|
10598
10607
|
const configDest = path36.join(cwd, "kody.config.json");
|
|
10599
10608
|
if (!fs37.existsSync(configDest)) {
|
|
10600
10609
|
const defaultConfig = {
|
|
@@ -10645,6 +10654,19 @@ async function parseInputsCommand() {
|
|
|
10645
10654
|
async function checkoutBranchCommand() {
|
|
10646
10655
|
await Promise.resolve().then(() => (init_checkout_task_branch(), checkout_task_branch_exports));
|
|
10647
10656
|
}
|
|
10657
|
+
function copyDirRecursive(src, dest, force) {
|
|
10658
|
+
fs37.mkdirSync(dest, { recursive: true });
|
|
10659
|
+
for (const entry of fs37.readdirSync(src, { withFileTypes: true })) {
|
|
10660
|
+
const srcPath = path36.join(src, entry.name);
|
|
10661
|
+
const destPath = path36.join(dest, entry.name);
|
|
10662
|
+
if (entry.isDirectory()) {
|
|
10663
|
+
copyDirRecursive(srcPath, destPath, force);
|
|
10664
|
+
} else {
|
|
10665
|
+
if (fs37.existsSync(destPath) && !force) continue;
|
|
10666
|
+
fs37.copyFileSync(srcPath, destPath);
|
|
10667
|
+
}
|
|
10668
|
+
}
|
|
10669
|
+
}
|
|
10648
10670
|
var program = new Command2().name("kody-engine").version(getVersion()).description("Kody CI/CD pipeline engine");
|
|
10649
10671
|
program.command("init").description("Initialize Kody in the current repo (copies workflow + config)").option("-f, --force", "Overwrite existing files", false).option("-w, --workflow-only", "Only copy the workflow file", false).action(initCommand);
|
|
10650
10672
|
program.command("run", { isDefault: true }).description("Run the Kody pipeline (default command)").allowUnknownOption().allowExcessArguments().action(runCommand);
|