Skip to content

Commit

Permalink
refactor: cleanup implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Jun 15, 2024
1 parent 7c95b74 commit e0bb0cc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions git-cliff-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "git-cliff-core"
version = "2.3.0" # managed by release.sh
version = "2.3.0" # managed by release.sh
description = "Core library of git-cliff"
authors = ["git-cliff contributors <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand All @@ -17,6 +17,7 @@ default = ["repo"]
## You can turn this off if you already have the commits to put in the
## changelog and you don't need `git-cliff` to parse them.
repo = ["dep:git2", "dep:glob", "dep:indexmap"]
# Enable integration with remote repositories.
remote = [
"dep:reqwest",
"dep:http-cache-reqwest",
Expand All @@ -37,7 +38,7 @@ gitlab = ["remote"]
## to make network requests to the Bitbucket API.
bitbucket = ["remote"]
## Enable integration with Gitea.
## You can turn this off if you don't use Bitbucket and don't want
## You can turn this off if you don't use Gitea and don't want
## to make network requests to the Gitea API.
gitea = ["remote"]

Expand Down
5 changes: 3 additions & 2 deletions git-cliff-core/src/remote/gitea.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use std::env;

use super::*;

const CODEBERG_API_URL: &str = "https://codeberg.org";
/// Gitea API url.
const GITEA_API_URL: &str = "https://codeberg.org";

/// Environment variable for overriding the Gitea REST API url.
const GITEA_API_URL_ENV: &str = "GITEA_API_URL";
Expand Down Expand Up @@ -146,7 +147,7 @@ impl RemoteClient for GiteaClient {
fn api_url() -> String {
env::var(GITEA_API_URL_ENV)
.ok()
.unwrap_or_else(|| CODEBERG_API_URL.to_string())
.unwrap_or_else(|| GITEA_API_URL.to_string())
}

fn remote(&self) -> Remote {
Expand Down
6 changes: 3 additions & 3 deletions git-cliff/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "git-cliff"
version = "2.3.0" # managed by release.sh
version = "2.3.0" # managed by release.sh
description = "A highly customizable changelog generator ⛰️"
authors = ["git-cliff contributors <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand All @@ -26,7 +26,7 @@ path = "src/bin/mangen.rs"
default = ["update-informer", "github", "gitlab", "gitea", "bitbucket"]
# inform about new releases
update-informer = ["dep:update-informer"]
# enable code forge integration
# enable remote repository integration
remote = ["dep:indicatif"]
# enable GitHub integration
github = ["remote", "git-cliff-core/github"]
Expand All @@ -53,7 +53,7 @@ indicatif = { version = "0.17.8", optional = true }
env_logger = "0.10.2"

[dependencies.git-cliff-core]
version = "2.3.0" # managed by release.sh
version = "2.3.0" # managed by release.sh
path = "../git-cliff-core"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion git-cliff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ pub fn run(mut args: Opt) -> Result<()> {
config.remote.gitlab.token.clone_from(&args.gitlab_token);
}
if args.gitea_token.is_some() {
config.remote.gitea.token.clone_from(&args.gitlab_token);
config.remote.gitea.token.clone_from(&args.gitea_token);
}
if args.bitbucket_token.is_some() {
config
Expand Down

0 comments on commit e0bb0cc

Please sign in to comment.