Fix built-in template rename order

This commit is contained in:
2026-04-26 20:48:26 +08:00
parent 8da042ccd3
commit 11576a8693
12 changed files with 220 additions and 1582 deletions

View File

@@ -1,29 +1,17 @@
mod commands;
mod entity;
mod utils;
mod error;
mod config;
mod template;
mod utils;
use crate::commands::{Cli, Commands};
use clap::Parser;
use std::{env, fs, path::PathBuf};
fn main() {
let cli = Cli::parse();
let temp_dir = check_temp_dir();
match &cli.command {
Commands::Release(args) => commands::release::execute(args),
Commands::Create(args) => commands::create::execute(args, &temp_dir),
Commands::Create(args) => commands::create::execute(args),
Commands::Components(args) => commands::components::execute(args),
}
}
fn check_temp_dir() -> PathBuf {
let mut temp_dir = env::temp_dir();
temp_dir.push("emod-cli");
if let Err(e) = fs::create_dir_all(&temp_dir) {
eprintln!("Error: Failed to create temp directory: {}", e);
}
temp_dir
}