Gate the rust-src-dir check by first checking if the value is set

This commit is contained in:
Jonas Bushart
2025-10-04 12:57:01 +02:00
parent d6688fbd7a
commit 51897173ae

View File

@@ -169,13 +169,19 @@ runs:
rust_src_dir: ${{inputs.rust-src-dir}}
shell: bash
run: |
if [[ -d "$rust_src_dir" ]]; then
# Check if value is set
if [[ -n "$rust_src_dir" ]]
then
# If value is set the directory must exist
if [[ -d "$rust_src_dir" ]]
then
cd "$rust_src_dir"
else
echo "'rust-src-dir' does not point to an existing directory" >&2
echo "The value of 'rust-src-dir' is: ${rust_src_dir}" >&2
exit 1
fi
fi
if [[ -z "$toolchain" && ( -f "rust-toolchain" || -f "rust-toolchain.toml") ]]
then
# Install the toolchain as specified in the file