Skip to content

Commit 9ea86b1

Browse files
committed
Remove parts of build.rs which won't work with github workflow
1 parent 3a98158 commit 9ea86b1

File tree

2 files changed

+3
-38
lines changed

2 files changed

+3
-38
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hypermon"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
edition = "2021"
55
rust-version = "1.80.1"
66

build.rs

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
use std::{
2-
env, fs,
3-
io::Read,
4-
path::PathBuf,
5-
process::{Command, Stdio},
6-
};
1+
use std::{env, fs, path::PathBuf};
72

83
fn main() -> std::io::Result<()> {
94
let config = std::fs::read_to_string("Cargo.toml")?;
@@ -22,39 +17,9 @@ fn main() -> std::io::Result<()> {
2217
let out_dir = env::var("OUT_DIR").unwrap();
2318
let dest_path = PathBuf::from(out_dir).join("version_file");
2419

25-
// Input buffers
26-
let mut branch_buf = String::new();
27-
let mut head_buf = String::new();
28-
29-
let _ = Command::new("git")
30-
.arg("branch")
31-
.arg("--show-current")
32-
.stdout(Stdio::piped())
33-
.spawn()
34-
.expect("Couldn't get the current branch")
35-
.stdout
36-
.unwrap()
37-
.read_to_string(&mut branch_buf);
38-
let _ = Command::new("git")
39-
.arg("rev-parse")
40-
.arg("HEAD")
41-
.stdout(Stdio::piped())
42-
.spawn()
43-
.expect("Couldn't get the current Git HEAD")
44-
.stdout
45-
.unwrap()
46-
.read_to_string(&mut head_buf);
47-
48-
branch_buf.remove(branch_buf.len() - 1);
49-
head_buf.remove(head_buf.len() - 1);
20+
fs::write(&dest_path, format!("{}", version_str)).unwrap();
5021

5122
println!("cargo:rerun-if-changed=Cargo.toml");
5223

53-
fs::write(
54-
&dest_path,
55-
format!("{} on {} with {}", version_str, branch_buf, head_buf),
56-
)
57-
.unwrap();
58-
5924
Ok(())
6025
}

0 commit comments

Comments
 (0)