diff --git a/Cargo.toml b/Cargo.toml index 7ef08df..bd376ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,10 @@ license = "MIT/Apache-2.0" repository = "https://github.com/fankaiLiu/salvo-cli" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[bin]] +name = "salvo" +path = "src/main.rs" + [dependencies] ansi_term = "0.12.1" anyhow = "1.0.75" @@ -19,4 +23,4 @@ handlebars = "4.4.0" serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.107" unicode-xid = "0.2.4" -rust-i18n = "2" \ No newline at end of file +rust-i18n = "2" diff --git a/README.md b/README.md index 8884063..955bfe2 100644 --- a/README.md +++ b/README.md @@ -30,58 +30,58 @@ To create a new Salvo project, use the new command followed by the name of your ```bash //use the local language -salvo-cli new project_name +salvo new project_name // Use English -salvo-cli new project_name --lang=en +salvo new project_name --lang=en // 使用简体中文 -salvo-cli new project_name --lang=zh +salvo new project_name --lang=zh // 使用繁體中文 -salvo-cli new project_name --lang=zh_TW +salvo new project_name --lang=zh_TW // Utilisez le français -salvo-cli new project_name --lang=fr +salvo new project_name --lang=fr // 日本語を使用する -salvo-cli new project_name --lang=ja +salvo new project_name --lang=ja // Usa el español -salvo-cli new project_name --lang=es +salvo new project_name --lang=es // Verwenden Sie Deutsch -salvo-cli new project_name --lang=de +salvo new project_name --lang=de // Используйте русский -salvo-cli new project_name --lang=ru +salvo new project_name --lang=ru // Usa l `italiano -salvo-cli new project_name --lang=it +salvo new project_name --lang=it // Use o português -salvo-cli new project_name --lang=pt +salvo new project_name --lang=pt // 한국어를 사용하십시오 -salvo-cli new project_name --lang=ko +salvo new project_name --lang=ko // Bruk norsk -salvo-cli new project_name --lang=no +salvo new project_name --lang=no // Notaðu íslensku -salvo-cli new project_name --lang=is +salvo new project_name --lang=is // Використовуйте українську -salvo-cli new project_name --lang=uk +salvo new project_name --lang=uk // ใช้ภาษาไทย -salvo-cli new project_name --lang=th +salvo new project_name --lang=th // Χρησιμοποιήστε την ελληνική -salvo-cli new project_name --lang=el +salvo new project_name --lang=el // Brug dansk -salvo-cli new project_name --lang=da +salvo new project_name --lang=da ``` ## Update diff --git a/locales/app.yml b/locales/app.yml index abe087a..b59d976 100644 --- a/locales/app.yml +++ b/locales/app.yml @@ -418,4 +418,4 @@ access_instructions: uk: Після його запуску Ви можете отримати доступ до /login за допомогою стандартного імені користувача:zhangsan та пароля:123 th: หลังจากทำการรันแล้ว คุณสามารถเข้าถึง /login ด้วยชื่อผู้ใช้งานเริ่มต้น:zhangsan และรหัสผ่าน:123 el: Αφού το τρέξετε, μπορείτε να προσπελάσετε το /login με το προεπιλεγμένο όνομα χρήστη:zhangsan και τον κωδικό πρόσβασης:123 - da: Efter du har kørt det, kan du få adgang til /login med standard brugernavn:zhangsan og adgangskode:123 \ No newline at end of file + da: Efter du har kørt det, kan du få adgang til /login med standard brugernavn:zhangsan og adgangskode:123 diff --git a/src/utils/create_project.rs b/src/utils/create_project.rs index 743ac3b..974b391 100644 --- a/src/utils/create_project.rs +++ b/src/utils/create_project.rs @@ -45,7 +45,13 @@ pub fn create_project(project: Project) -> Result<()> { } fn after_print_info(project_name: &String, config: UserSelected) { + println!(); // a new line + + // print success info success(t!("create_success", project_name = project_name).replace(r"\n", "\n")); + + println!(); // a new line + match config.db_conn_type { DbConnectionType::Sqlx => { success(t!("create_success_sqlx").replace(r"\n", "\n")); diff --git a/src/utils/print_util.rs b/src/utils/print_util.rs index b996462..9faf894 100644 --- a/src/utils/print_util.rs +++ b/src/utils/print_util.rs @@ -2,17 +2,19 @@ use ansi_term::Colour::{Blue, Green, Red, Yellow}; pub fn print_logo() { let art = r" - _______________________ ________ ______________________ - __ ___/__ |__ /__ | / /_ __ \ __ ____/__ /____ _/ - _____ \__ /| |_ / __ | / /_ / / / _ / __ / __ / - ____/ /_ ___ | /____ |/ / / /_/ / / /___ _ /____/ / - /____/ /_/ |_/_____/____/ \____/ \____/ /_____/___/ + ____ _ _ __ _____ ____ _ ___ + / ___| / \ | |\ \ / / _ \ / ___| | |_ _| + \___ \ / _ \ | | \ \ / / | | | | | | | | | + ___) / ___ \| |__\ V /| |_| | | |___| |___ | | + |____/_/ \_\_____\_/ \___/ \____|_____|___| + "; let lines = art.lines(); for line in lines { let (part_blue, part_green) = line.split_at(line.len() / 2); println!("{}{}", Blue.paint(part_blue), Green.paint(part_green)); } + println!(); // a new line } pub fn warning>(msg: S) {