@gabortorma/mwm
Version:
Multi-repo Workspace Manager
78 lines (75 loc) • 1.95 kB
JavaScript
import { defineCommand } from 'citty';
import { j as selectTemplate, i as getRepo } from '../shared/mwm.DQkHySFI.mjs';
import { generate } from '../commands/generate/generate.mjs';
import 'simple-git';
import 'node:path';
import 'consola';
import '../shared/mwm.Bxg0O5XR.mjs';
import 'c12';
import '../shared/mwm.CyrEUDRq.mjs';
import 'node:process';
import '@octokit/rest';
import 'pkg-types';
import 'replace-in-file';
import 'change-case';
import '../shared/mwm.BwrzNYCL.mjs';
import 'node:child_process';
const main = defineCommand({
meta: {
name: "generate",
description: "Generate new repo from template"
},
args: {
template: {
type: "string",
description: "Select template (layer, package, release)"
},
owner: {
alias: "organization",
type: "string",
description: "Owner (organization) of the new repo"
},
name: {
type: "string",
description: "Name of the new repo"
},
description: {
alias: "desc",
type: "string",
description: "Description of the new repo"
},
dir: {
type: "string",
description: "Directory to clone the new repo"
},
private: {
type: "boolean",
default: false,
description: "Create a private repository"
},
keywords: {
type: "string",
description: "Keywords (comma separated)"
},
clone: {
type: "boolean",
description: "Clone the repo instead of submodule"
},
addRemoteTemplate: {
alias: "add-remote-template",
type: "boolean",
description: "Add remote template repository"
},
fixReplacements: {
alias: "fix-replacements",
type: "boolean",
description: "Fix replacements"
}
},
async run({ args }) {
const template = await selectTemplate(args.template);
const repo = await getRepo(args, template);
await generate(args, template, repo);
}
});
export { main };