Skip to content

Commit

Permalink
feat(cli): deprecate create command (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Feb 20, 2023
1 parent 9330e3a commit 292119f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/cli/src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,21 @@ type Options = {
export const command = "create <name>";
export const desc = "Sets up a mud project into <name>. Requires yarn.";

export const deprecated = true;

export const builder: CommandBuilder<Options, Options> = (yargs) =>
yargs
.options({
template: { type: "string", desc: "Template to be used (available: [minimal])", default: "minimal" },
template: { type: "string", desc: "Template to be used (available: [minimal, react])", default: "minimal" },
})
.positional("name", { type: "string", default: "mud-app" });

export const handler = async (argv: Arguments<Options>): Promise<void> => {
const { name, template } = argv;
console.log(chalk.yellow.bold("Creating new mud project in", name));
let result = await execLog("git", ["clone", `https://github.com/latticexyz/mud-template-${template}`, name]);
if (result.exitCode != 0) process.exit(result.exitCode);
console.log(chalk.red.bold("⚠️ This command will be removed soon. Use `yarn create mud` instead."));

console.log(chalk.yellow.bold("Installing dependencies..."));
result = await execLog("yarn", ["--cwd", `./${name}`]);
const result = await execLog("yarn", ["create", "mud", name, "--template", template]);
if (result.exitCode != 0) process.exit(result.exitCode);

console.log(chalk.yellow.bold(`Done! Run \`yarn dev\` in ${name} to get started.`));
process.exit(0);
};

0 comments on commit 292119f

Please sign in to comment.