fork refine

This commit is contained in:
Stefan Pejcic
2024-02-05 10:23:04 +01:00
parent 3fffde9a8f
commit 8496a83edb
3634 changed files with 715528 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
import { Command } from "commander";
import { getProjectType } from "@utils/project";
import { getResourcePath } from "@utils/resource";
import { createResources } from "@commands/add/create-resource";
const load = (program: Command) => {
const projectType = getProjectType();
const { path } = getResourcePath(projectType);
return program
.command("create-resource")
.allowExcessArguments(true)
.description(
`Create a new resource files (deprecated, please use "add resource" command)`,
)
.option(
"-a, --actions [actions]",
"Only generate the specified actions. (ex: list,create,edit,show)",
"list,create,edit,show",
)
.option(
"-p, --path [path]",
"Path to generate the resource files",
path,
)
.action(action);
};
const action = async (
params: { actions: string; path: string },
options: Command,
) => {
createResources(params, options.args);
};
export default load;