Closed jonpas closed 4 years ago
This should already be the case
hemtt build --debug
will also tell you where the binarize executable was found
Debug does indeed, but it's crowded in a lot of other debug data, and it does it only on Windows if binarizer is found. I think that's pretty important to show to the user and should be displayed in normal mode. At least if it's binarizing or not binarizing.
if match armake2::find_binarize_exe() {
Ok(p) => {
debug!("binarize found at {:?}", p);
p.exists()
}
Err(_) => false,
} {
true
} else {
warnmessage!("Unable to locate binarize.exe", "Files will be packed as is");
false
};
It prints a message if binarize is not found
I am not seeing the warning message anywhere (release or normal build).
if {
// code
} {
true
} else {
// code
}
How does this work?
match armake2::find_binarize_exe() {
Ok(p) => {
debug!("binarize found at {:?}", p);
p.exists()
}
Err(_) => false,
}
find_binarize_exe
returns a Result<Path, Error>
, the match is used to get the path if it is Ok. If it is Ok it calls p.exists()
which will return a boolean. The find_binarize_exe
was unable to find the executable then it ignores the error and just returns false. The resulting boolean is then what is fed into the wrapping if statement.
It's not
if {
// code
} {
}
it's
if (code) {
}
Alright, I see.
And I also see why it doesn't work. That match
will never run if this is not on Windows. Rust does lazy evaluation, so as soon as cfg!(windows)
is false
, it stops evaluating that condition, meaning match find_binarize_exe()
will never run and thus never print an error.
HEMTT Version:
0.7.4
(stable) Project: AnyDescription:
Output some information about used or unused binarizer (Windows/Linux) as is the case with armake2.
Steps to reproduce:
Additional information:
N/A
HEMTT Output:
N/A