Fix env parsing

This commit is contained in:
Wilson Lin 2021-08-08 23:39:42 +10:00
parent f6d40886f6
commit 76215a297d
3 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ for r in *; do
echo "Running $r..."
pushd "$r" >/dev/null
out="$results_dir/$r.json"
sudo --preserve-env=MHB_HTML_ONLY,PATH MHB_ITERATIONS="$iterations" MHB_INPUT_DIR="$input_dir" nice -n -20 taskset -c 1 ./run >"$out"
sudo --preserve-env=MHB_HTML_ONLY,PATH MHB_ITERATIONS="$iterations" MHB_INPUT_DIR="$input_dir" RUST_BACKTRACE=1 nice -n -20 taskset -c 1 ./run >"$out"
popd >/dev/null
done
popd >/dev/null

View File

@ -7,7 +7,7 @@ use minify_html_onepass::{Cfg, in_place};
fn main() {
let iterations = env::var("MHB_ITERATIONS").unwrap().parse::<usize>().unwrap();
let input_dir = env::var("MHB_INPUT_DIR").unwrap();
let html_only = env::var("MHB_HTML_ONLY").unwrap() == "1";
let html_only = env::var("MHB_HTML_ONLY").ok().filter(|v| v == "1").is_some();
let tests = fs::read_dir(input_dir).unwrap().map(|d| d.unwrap());

View File

@ -7,7 +7,7 @@ use minify_html::{Cfg, minify};
fn main() {
let iterations = env::var("MHB_ITERATIONS").unwrap().parse::<usize>().unwrap();
let input_dir = env::var("MHB_INPUT_DIR").unwrap();
let html_only = env::var("MHB_HTML_ONLY").unwrap() == "1";
let html_only = env::var("MHB_HTML_ONLY").ok().filter(|v| v == "1").is_some();
let tests = fs::read_dir(input_dir).unwrap().map(|d| d.unwrap());