Skip to content

Commit

Permalink
update version
Browse files Browse the repository at this point in the history
  • Loading branch information
fankaiLiu committed Oct 29, 2023
1 parent 7e943b9 commit 3cb512e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "salvo-cli"
version = "0.1.15"
version = "0.1.16"
edition = "2021"
authors = ["Fankai Liu [email protected]"]
keywords = ["salvo", "cli","template"]
Expand Down
45 changes: 29 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,58 @@
<div align="center">
<p><img alt="Savlo" width="132" style="max-width:40%;min-width:60px;" src="https://p.sda1.dev/13/9268fb110f27611fa143c7aafbac61ab/monkeybread4352_a_technology_software_logo_for_windseabird_with_8fb4a0df-e233-414e-80a3-cf144ef44209.png" />
<a href="https://github.com/salvo-rs/salvo-cli/actions">
<img alt="build status" src="https://github.com/salvo-rs/salvo-cli/actions/workflows/rust.yml/badge.svg?branch=main" />
</a>
<a href="https://crates.io/crates/salvo-cli"><img alt="crates.io" src="https://img.shields.io/crates/v/salvo-cli" /></a>
<a href="https://crates.io/crates/salvo-cli"><img alt="Download" src="https://img.shields.io/crates/d/salvo-cli.svg" /></a>
<img alt="License" src="https://img.shields.io/crates/l/salvo-cli.svg" />
</p>
<img alt="Savlo" width="132" src="https://p.sda1.dev/13/9268fb110f27611fa143c7aafbac61ab/monkeybread4352_a_technology_software_logo_for_windseabird_with_8fb4a0df-e233-414e-80a3-cf144ef44209.png" />
</div>
<div align="center">
<a href="https://github.com/salvo-rs/salvo-cli/actions">
<img alt="build status" src="https://github.com/salvo-rs/salvo-cli/actions/workflows/rust.yml/badge.svg?branch=main" />
</a>
<a href="https://crates.io/crates/salvo-cli">
<img alt="crates.io" src="https://img.shields.io/crates/v/salvo-cli" />
</a>
<a href="https://crates.io/crates/salvo-cli">
<img alt="Download" src="https://img.shields.io/crates/d/salvo-cli.svg" />
</a>
<img alt="License" src="https://img.shields.io/crates/l/salvo-cli.svg" />
</div>

## Introduction

Salvo CLI is a command-line interface tool for the [Salvo](https://github.com/salvo-rs/salvo) web framework. It helps streamline the process of setting up a new Salvo project by generating a template structure.

## Installation

```bash
cargo install salvo-cli
```

## Usage

To create a new Salvo project, use the new command followed by the name of your project:

```bash
salvo-cli new project_name
```

## Update

```bashs
cargo install --force salvo-cli
```

### Feature Development Plan

| Status |Plan |
|:---:|:---:|
|| web api template |
|| web site template |
||Template with SQLx, SeaORM, Diesel, Rbatis (support for SQLite, PostgreSQL, MySQL)|
||Basic middleware |
||More middleware|
||Support for MongoDB|
| Status | Plan |
| :----: | :--------------------------------------------------------------------------------: |
|| web api template |
|| web site template |
|| Template with SQLx, SeaORM, Diesel, Rbatis (support for SQLite, PostgreSQL, MySQL) |
|| Basic middleware |
|| More middleware |
|| Support for MongoDB |

## License

This project is licensed under the MIT OR Apache-2.0 License.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
24 changes: 11 additions & 13 deletions src/utils/create_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,32 @@ fn after_print_info(project_name: &String, config: UserSelected) {
match config.db_conn_type {
DbConnectionType::Sqlx => {
success(t!("create_success_sqlx").replace(r"\n", "\n"));
match config.db_type
{
match config.db_type {
DbType::Sqlite => {
success(t!("create_success_sqlx_sqlite").replace(r"\n", "\n"));
},
_=>{
success(t!("create_success_mysql_or_pgsql").replace(r"\n", "\n"));
}
_ => {
success(t!("create_success_mysql_or_pgsql").replace(r"\n", "\n"));
}
}
}
DbConnectionType::SeaOrm => {
success(t!("create_success_sea_orm").replace(r"\n", "\n"));
match config.db_type
{
match config.db_type {
DbType::Sqlite => {
success(t!("create_success_sqlx_sqlite").replace(r"\n", "\n"));
},
_=>{
success(t!("create_success_mysql_or_pgsql").replace(r"\n", "\n"));
}
_ => {
success(t!("create_success_mysql_or_pgsql").replace(r"\n", "\n"));
}
}
}
DbConnectionType::Diesel => match config.db_type {
DbType::Sqlite => {
success(t!("create_success_sqlx_diesel").replace(r"\n", "\n"));
},
_=>{
success(t!("create_success_mysql_or_pgsql").replace(r"\n", "\n"));
}
_ => {
success(t!("create_success_mysql_or_pgsql").replace(r"\n", "\n"));
}
},
DbConnectionType::Rbatis => match config.db_type {
Expand Down

0 comments on commit 3cb512e

Please sign in to comment.