Skip to content

Commit

Permalink
feat: add cargo-generate config and update cliff config
Browse files Browse the repository at this point in the history
  • Loading branch information
fan-tastic-z committed Aug 6, 2024
1 parent 0a027be commit 44fd764
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,6 @@ cargo install git-cliff
cargo generate fan-tastic-z/rust-project-template
```

### 替换项目名称

修改项目目录下`Cargo.toml` 中的package name 为自己的项目名称

```toml
[package]
name = "rust-project-template"
```

### 替换 cliff 配置

替换 `cliff.toml` 配置文件中 下面配置中 replace 的值为自己的仓库地址

```toml
postprocessors = [
{ pattern = '\$REPO', replace = "https://github.com/fan-tastic-z/rust-project-template" }, # replace repository URL
]
```

### 安装 git hook scripts

在项目目录下执行
Expand Down
3 changes: 3 additions & 0 deletions cargo-generate.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[template]
ignore = ["cargo-generate.toml"]
cargo_generate_version = ">=0.21.0"
2 changes: 1 addition & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ footer = """
trim = true
# postprocessors
postprocessors = [
{ pattern = '\$REPO', replace = "https://github.com/fan-tastic-z/rust-project-template" }, # replace repository URL
{ pattern = '\$REPO', replace = "https://github.com/{{gh-username}}/{{project-name}}" }, # replace repository URL
]

[git]
Expand Down

0 comments on commit 44fd764

Please sign in to comment.