Print an error and exit if 'rust-src-dir' does not point to an existing directory

This commit is contained in:
Jonas Bushart
2025-10-03 23:23:33 +02:00
parent 02be93da58
commit d6688fbd7a

View File

@@ -171,6 +171,10 @@ runs:
run: |
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
if [[ -z "$toolchain" && ( -f "rust-toolchain" || -f "rust-toolchain.toml") ]]
then
@@ -201,7 +205,12 @@ runs:
- id: versions
name: Print installed versions
shell: bash
env:
rust_src_dir: ${{inputs.rust-src-dir}}
run: |
# Switch to the selected sub-directory for
cd "$rust_src_dir"
echo "rustc-version=$(rustc --version)" >> $GITHUB_OUTPUT
rustc --version --verbose
echo "cargo-version=$(cargo --version)" >> $GITHUB_OUTPUT