Skip to content

Commit be7ddb8

Browse files
author
michael.biriley@firstaml.com
committed
Fix inverted logic and add 'else' condition
1 parent 8eea425 commit be7ddb8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

hooks/checkout

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,22 @@ NO_CONE_OPTION="$(plugin_read_config NO_CONE "false")"
1111
NO_CONE_PARAM=""
1212
[[ $NO_CONE_OPTION = false ]] || NO_CONE_PARAM="--no-cone"
1313

14-
SKIP_SSH_KEYSCAN_OPTION="$(plugin_read_config SKIP_SSH_KEYSCAN "false")"
15-
1614
if plugin_read_list_into_result PATHS; then
1715
CHECKOUT_PATHS=("${result[@]}")
1816
else
1917
echo "Missing 'paths' option in the plugin"
2018
exit 1
2119
fi
2220

23-
if [[ "$SKIP_SSH_KEYSCAN_OPTION" != "false" ]]; then
21+
SKIP_SSH_KEYSCAN_OPTION="$(plugin_read_config SKIP_SSH_KEYSCAN "false")"
22+
echo "SKIP_SSH_KEYSCAN_OPTION: $SKIP_SSH_KEYSCAN_OPTION"
23+
24+
if [ "$SKIP_SSH_KEYSCAN_OPTION" = "false" ]; then
2425
echo "Scanning SSH keys for remote git repository"
2526
[[ -d ~/.ssh ]] || mkdir -p ~/.ssh
2627
ssh-keyscan "${BUILDKITE_REPO_SSH_HOST}" >> ~/.ssh/known_hosts
28+
else
29+
echo "Skipping SSH keyscan"
2730
fi
2831

2932
echo "Creating sparse-checkout with paths: ${CHECKOUT_PATHS[*]}"

0 commit comments

Comments
 (0)