Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
Remove fetching the Noelware/analytics-protobuf git commit that it wa…
Browse files Browse the repository at this point in the history
…s built from
  • Loading branch information
auguwu committed Feb 4, 2023
1 parent 6f2d8b2 commit b97bae9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[package]
name = "analytics-rs"
description = "🐻‍❄️🐾 Rust client and server implementation of the Noelware Analytics Protocol"
version = "1.0.0"
version = "1.0.1"
homepage = "https://analytics.noelware.org"
edition = "2021"
authors = ["Noel Miko <[email protected]>", "Noelware Team <[email protected]>"]
Expand Down
16 changes: 1 addition & 15 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use std::{error::Error, ffi::OsStr, process::Command};

fn execute<T>(command: T, args: &[&str]) -> Result<String, Box<dyn Error + 'static>>
where
T: Into<String> + AsRef<OsStr>,
{
let res = Command::new(command).args(args).output()?;
Ok(String::from_utf8(res.stdout)?)
}
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
println!("cargo:rerun-if-changed=build.rs");

let binding = execute("git", &["submodule"])?;
let binding = binding.split(' ').collect::<Vec<_>>();
let protobufs_commit = binding.get(1).unwrap();

println!("cargo:rustc-env=PROTOBUFS_COMMIT_HASH={protobufs_commit}");

tonic_build::compile_protos("./vendor/protobufs/connection.proto")?;
Ok(())
}
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

pub const PROTOBUFS_COMMIT_HASH: &str = env!("PROTOBUFS_COMMIT_HASH");

mod pb {
include!(concat!(
env!("OUT_DIR"),
Expand Down

0 comments on commit b97bae9

Please sign in to comment.