mirror of
https://github.com/actions-rust-lang/setup-rust-toolchain.git
synced 2025-12-27 01:54:20 -05:00
Gate the rust-src-dir check by first checking if the value is set
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user