File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -169,12 +169,18 @@ runs:
169169 rust_src_dir : ${{inputs.rust-src-dir}}
170170 shell : bash
171171 run : |
172- if [[ -d "$rust_src_dir" ]]; then
173- cd "$rust_src_dir"
174- else
175- echo "'rust-src-dir' does not point to an existing directory" >&2
176- echo "The value of 'rust-src-dir' is: ${rust_src_dir}" >&2
177- exit 1
172+ # Check if value is set
173+ if [[ -n "$rust_src_dir" ]]
174+ then
175+ # If value is set the directory must exist
176+ if [[ -d "$rust_src_dir" ]]
177+ then
178+ cd "$rust_src_dir"
179+ else
180+ echo "'rust-src-dir' does not point to an existing directory" >&2
181+ echo "The value of 'rust-src-dir' is: ${rust_src_dir}" >&2
182+ exit 1
183+ fi
178184 fi
179185 if [[ -z "$toolchain" && ( -f "rust-toolchain" || -f "rust-toolchain.toml") ]]
180186 then
You can’t perform that action at this time.
0 commit comments