mirror of
https://github.com/lune-org/lune.git
synced 2024-12-14 06:00:42 +00:00
14 lines
456 B
Rust
14 lines
456 B
Rust
|
pub fn get_github_owner_and_repo() -> (String, String) {
|
||
|
let (github_owner, github_repo) = env!("CARGO_PKG_REPOSITORY")
|
||
|
.strip_prefix("https://github.com/")
|
||
|
.unwrap()
|
||
|
.split_once('/')
|
||
|
.unwrap();
|
||
|
(github_owner.to_owned(), github_repo.to_owned())
|
||
|
}
|
||
|
|
||
|
pub fn get_request_user_agent_header() -> String {
|
||
|
let (github_owner, github_repo) = get_github_owner_and_repo();
|
||
|
format!("{github_owner}-{github_repo}-cli")
|
||
|
}
|