mirror of
https://github.com/CompeyDev/lune-packaging.git
synced 2025-01-11 13:09:11 +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")
|
||
|
}
|