Rewrite rust #38
@ -24,6 +24,7 @@ pub fn execute_cmd() -> Command {
|
|||||||
Arg::new("gitea-http-token")
|
Arg::new("gitea-http-token")
|
||||||
.long("gitea-http-token")
|
.long("gitea-http-token")
|
||||||
.action(ArgAction::Set)
|
.action(ArgAction::Set)
|
||||||
|
.env("GITEA_HTTP_TOKEN")
|
||||||
.required(false),
|
.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 gitea_http_token = args.get_one::<String>("gitea-http-token");
|
||||||
|
|
||||||
let service_register = ServiceRegister::new(
|
let service_register = ServiceRegister::new(
|
||||||
LocalGitProviderOptions {
|
LocalGitProviderOptions { http_auth: None },
|
||||||
http_auth: gitea_http_token.map(|t| t.clone()),
|
|
||||||
},
|
|
||||||
DefaultGiteaClientOptions {
|
DefaultGiteaClientOptions {
|
||||||
url: "https://git.front.kjuulh.io/api/v1".into(),
|
url: "https://git.front.kjuulh.io/api/v1".into(),
|
||||||
basicauth: Some("kjuulh:".into()),
|
basicauth: gitea_http_token.map(|t| t.clone()),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user