UNPKG

@gabortorma/mwm

Version:

Multi-repo Workspace Manager

80 lines (76 loc) 2.02 kB
'use strict'; const citty = require('citty'); const index = require('../shared/mwm.C9KLt13K.cjs'); const commands_generate_generate = require('../commands/generate/generate.cjs'); require('simple-git'); require('node:path'); require('consola'); require('../shared/mwm.b-NRmH8L.cjs'); require('c12'); require('../shared/mwm.Bc81aV-e.cjs'); require('node:process'); require('@octokit/rest'); require('pkg-types'); require('replace-in-file'); require('change-case'); require('../shared/mwm.DTKjIVEs.cjs'); require('node:child_process'); const main = citty.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 index.selectTemplate(args.template); const repo = await index.getRepo(args, template); await commands_generate_generate.generate(args, template, repo); } }); exports.main = main;