Skip to content

Commit f1ddec9

Browse files
committed
Need to create bin directory before trying to install ourselves.
1 parent 66f166e commit f1ddec9

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

adp-connect.sh

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ download_latest_release() {
226226
done
227227

228228
if [[ -z "$binary_url" ]]; then
229-
error "❌ Error: Could not find the binary $binary_name for $LOCAL_OS/$LOCAL_ARCH in the latest release."
229+
error "❌ Error: Could not find the binary $binary_name for $LOCAL_OS/${LOCAL_ARCH[0]} in the latest release."
230230

231231
if [[ "${ENABLE_DEBUG}" = "true" ]]; then
232232
if which yq &>/dev/null; then
@@ -355,6 +355,7 @@ rancher_login() {
355355
fi
356356

357357
# Remove protocol if present
358+
# shellcheck disable=SC2001
358359
rancher_hostname=$(echo "$rancher_hostname" | sed -e 's|^[a-zA-Z]*://||')
359360

360361
if [[ -e "${HOME}/.rancher/cli2.json" ]] && [[ "$(rancher server ls | grep -c "${rancher_hostname}")" -gt 1 ]]; then
@@ -462,6 +463,11 @@ setup_kube_context() {
462463
exit 1
463464
fi
464465

466+
instruction "It's time to setup the default Kubernetes cluster, project, and namespace you'll be using. \
467+
You'll be presented with lists and asked to pick a number; pay attention to the columns. You'll first select \
468+
your default Rancher server (if you have multiple) and then your Cluster and Project. Look for the row with \
469+
the project you'll use most often and enter the number in the first column."
470+
465471
DEFAULT_NAMESPACE=""
466472
RANCHER_CURRENT_CLUSTER=""
467473

@@ -563,6 +569,13 @@ if [[ "${ALL_BINARIES_AVAILABLE}" = "false" ]]; then
563569
exit 1
564570
fi
565571

572+
if ! [[ -d "$HOME/.local/bin" ]]; then
573+
if ! mkdir -p "${HOME}"/.local/bin 2>/dev/null; then
574+
echo "❌ Error: Failed to create directory ${HOME}/.local/bin. Please check your permissions or available disk space."
575+
exit 1
576+
fi
577+
fi
578+
566579
if ! [ -t 0 ] && [[ "${ONLY_DOWNLOAD}" != "true" ]]; then
567580
echo "Looks like you're running non-interactive, like from 'curl'."
568581
echo "Since this tool asks a lot of questions, it cannot be run this way. Installing to ${HOME}/.local/bin..."
@@ -597,8 +610,8 @@ if ! [ -t 0 ] && [[ "${ONLY_DOWNLOAD}" != "true" ]]; then
597610
fi
598611

599612
# shellcheck disable=SC2016
600-
echo 'adp-connect has been installed, please re-run it in a terminal with the command \
601-
adp-connect, use `adp-connect -h` for help.'
613+
echo 'adp-connect has been installed, please re-run it in a terminal with the command
614+
adp-connect, use `adp-connect -h` for help.'
602615

603616
exit 1
604617
fi
@@ -622,13 +635,6 @@ if ! (grep --help 2>/dev/null | grep -q 'extended-regexp') && ! (which sw_vers >
622635
exit 1
623636
fi
624637

625-
if ! [[ -d "$HOME/.local/bin" ]]; then
626-
if ! mkdir -p "${HOME}"/.local/bin 2>/dev/null; then
627-
echo "❌ Error: Failed to create directory ${HOME}/.local/bin. Please check your permissions or available disk space."
628-
exit 1
629-
fi
630-
fi
631-
632638
if [[ -z "${ACCEPT_SUPPLY_CHAIN_SECURITY}" ]]; then
633639
if ! confirm "⚠️ This script will utilize a series of resources from \
634640
the internet. The integrity of these cannot be assured, are you sure you want to \
@@ -1166,7 +1172,7 @@ if [[ "${SETUP_INTERNAL_SERVICES}" = "true" ]]; then
11661172

11671173
helm repo update
11681174
fi
1169-
1170-
info "🎉 Everything should now be setup. You should have the following tools installed and ready to use:"
1171-
ls -1 "${HOME}"/.local/bin
11721175
fi
1176+
1177+
info "🎉 Everything should now be setup. You should have the following tools installed and ready to use:"
1178+
ls -1 "${HOME}"/.local/bin

0 commit comments

Comments
 (0)