mirror of
https://github.com/CompeyDev/lune-packaging.git
synced 2025-01-09 12:19:09 +00:00
Don't export everything in the lune lib
This commit is contained in:
parent
2e3f95ebd6
commit
420a861061
5 changed files with 18 additions and 3 deletions
|
@ -3,7 +3,7 @@ use std::env::current_dir;
|
|||
use anyhow::{bail, Context, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use lune::utils::net::{get_github_owner_and_repo, get_request_user_agent_header};
|
||||
use super::net::{get_github_owner_and_repo, get_request_user_agent_header};
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
pub struct ReleaseAsset {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
pub mod files;
|
||||
pub mod github;
|
||||
pub mod listing;
|
||||
pub mod net;
|
||||
|
|
13
packages/cli/src/utils/net.rs
Normal file
13
packages/cli/src/utils/net.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
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")
|
||||
}
|
|
@ -3,8 +3,8 @@ use std::{collections::HashSet, process::ExitCode, sync::Arc};
|
|||
use mlua::prelude::*;
|
||||
use tokio::{sync::mpsc, task};
|
||||
|
||||
pub mod globals;
|
||||
pub mod utils;
|
||||
pub(crate) mod globals;
|
||||
pub(crate) mod utils;
|
||||
|
||||
use crate::{
|
||||
globals::{
|
||||
|
|
|
@ -7,6 +7,7 @@ pub struct TableBuilder<'lua> {
|
|||
tab: LuaTable<'lua>,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl<'lua> TableBuilder<'lua> {
|
||||
pub fn new(lua: &'lua Lua) -> LuaResult<Self> {
|
||||
let tab = lua.create_table()?;
|
||||
|
|
Loading…
Reference in a new issue