Make error message more specific

This commit is contained in:
Boris Verkhovskiy 2023-01-08 08:10:14 -07:00
parent 9ac55f79d1
commit 61b85b2664
2 changed files with 10 additions and 1 deletions

View file

@ -65,6 +65,11 @@ pub fn compile_language_to_wasm(language_dir: &Path, force_docker: bool) -> Resu
// Run `emcc` in a container using the `emscripten-slim` image
command.args(&[EMSCRIPTEN_TAG, "emcc"]);
} else {
if force_docker {
return Err(anyhow!(
"You must have docker on your PATH to run this command with --docker"
));
}
return Err(anyhow!(
"You must have either emcc or docker on your PATH to run this command"
));

View file

@ -71,7 +71,11 @@ elif which docker > /dev/null; then
emscripten/emsdk:$emscripen_version \
emcc"
else
echo 'You must have either `docker` or `emcc` on your PATH to run this script'
if [[ "$force_docker" == "1" ]]; then
echo 'You must have `docker` on your PATH to run this script with --docker'
else
echo 'You must have either `docker` or `emcc` on your PATH to run this script'
fi
exit 1
fi