fix http token

This commit is contained in:
Kasper Juul Hermansen 2022-11-27 11:13:16 +01:00
parent a777b1d0a4
commit 1b350f58b4
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912

View File

@ -24,6 +24,7 @@ pub fn execute_cmd() -> Command {
Arg::new("gitea-http-token")
.long("gitea-http-token")
.action(ArgAction::Set)
.env("GITEA_HTTP_TOKEN")
.required(false),
)
}
@ -36,12 +37,10 @@ pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
let gitea_http_token = args.get_one::<String>("gitea-http-token");
let service_register = ServiceRegister::new(
LocalGitProviderOptions {
http_auth: gitea_http_token.map(|t| t.clone()),
},
LocalGitProviderOptions { http_auth: None },
DefaultGiteaClientOptions {
url: "https://git.front.kjuulh.io/api/v1".into(),
basicauth: Some("kjuulh:".into()),
basicauth: gitea_http_token.map(|t| t.clone()),
},
);