Compare commits

...

2 Commits

Author SHA1 Message Date
blek 99807b9722
fix few obscure errors 2023-10-29 19:25:53 +10:00
blek 32375127a9
display errors 2023-10-29 19:25:33 +10:00
2 changed files with 7 additions and 1 deletions

View File

@ -7,6 +7,7 @@ services:
networks: networks:
bfile: bfile:
volumes: volumes:
- './.git:/opt/code/.git'
- './filed:/opt/code' - './filed:/opt/code'
- './filed/config:/etc/filed' - './filed/config:/etc/filed'
- '/opt/code/target' - '/opt/code/target'

View File

@ -22,6 +22,11 @@ fn system(cmd: &str, args: &[&str]) -> String {
.args(args) .args(args)
.output() .output()
.unwrap(); .unwrap();
if out.stderr.len() != 0 {
panic!("Got this while running {cmd} with \"{}\": {}", args.join(" "), String::from_utf8(out.stderr).unwrap())
}
String::from_utf8(out.stdout).unwrap() String::from_utf8(out.stdout).unwrap()
} }
@ -69,7 +74,7 @@ fn main() {
}); });
let commit = system("git", &["rev-parse", "HEAD"]); let commit = system("git", &["rev-parse", "HEAD"]);
let branch = system("git", &["rev-parse", "--abbrev-rev", "HEAD"]); let branch = system("git", &["rev-parse", "--abbrev-ref", "HEAD"]);
println!("cargo:rustc-env=COMMIT_HASH={commit}"); println!("cargo:rustc-env=COMMIT_HASH={commit}");
println!("cargo:rustc-env=COMMIT_BRANCH={branch}"); println!("cargo:rustc-env=COMMIT_BRANCH={branch}");