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:
169
169
rust_src_dir : ${{inputs.rust-src-dir}}
170
170
shell : bash
171
171
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
178
184
fi
179
185
if [[ -z "$toolchain" && ( -f "rust-toolchain" || -f "rust-toolchain.toml") ]]
180
186
then
You can’t perform that action at this time.
0 commit comments