Skip to content

Commit e12781c

Browse files
committed
chore: explicitly define binary target
This commit explicitly defines the binary target for the `git-commit- helper` application within `Cargo.toml`. The `[[bin]]` section specifies that the `src/main.rs` file should be compiled into an executable named `git-commit-helper`. This ensures that the binary is consistently named when building or installing the package, overriding default Cargo conventions if necessary, and providing clarity for the project's executable definition. This is particularly important for tools intended to be installed globally or used as `git-commit-helper`, preventing potential issues with default naming or future package name changes. Influence: 1. Verify that `cargo build` completes successfully. 2. Verify that `cargo run` executes the application correctly. 3. Verify that `cargo install` installs the executable with the name `git-commit-helper` and that it runs from the command line. chore: 显式定义二进制目标 此提交在 `Cargo.toml` 中显式定义了 `git-commit-helper` 应用程序的二进 制目标。`[[bin]]` 部分指定 `src/main.rs` 文件应编译成名为 `git-commit- helper` 的可执行文件。这确保了在构建或安装包时,二进制文件的命名保持一 致,必要时可覆盖 Cargo 的默认约定,并为项目的可执行文件定义提供了清晰 性。这对于旨在全局安装或作为 `git-commit-helper` 使用的工具尤其重要,可 以避免默认命名可能出现的问题或未来包名称变更带来的影响。 Influence: 1. 验证 `cargo build` 命令能够成功完成。 2. 验证 `cargo run` 命令能够正确执行应用程序。 3. 验证 `cargo install` 命令能够将可执行文件安装为 `git-commit-helper`, 并能从命令行正常运行。
1 parent 8d52874 commit e12781c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ edition = "2021"
55
description = "A CLI tool to help generate standardized git commit messages"
66
license = "MIT"
77

8+
[[bin]]
9+
name = "git-commit-helper"
10+
path = "src/main.rs"
11+
812
[dependencies]
913
serde = { version = "1.0", features = ["derive"] }
1014
serde_json = "1.0"

0 commit comments

Comments
 (0)