You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
debug "resolved v${LMV} version '${ORIGINAL_VERSION}' to ${VERSION} (${URL})"
546
-
547
560
# force setup to 0 if lando 4
548
561
if [[ $SETUP=='1' ]] && [[ $LMV=='4' ]];then
549
562
SETUP=0
@@ -771,7 +784,9 @@ if [[ -z "${NONINTERACTIVE-}" ]]; then
771
784
# sudo prompt
772
785
if needs_sudo;then log "- ${tty_green}prompt${tty_reset} for ${tty_bold}sudo${tty_reset} password";fi
773
786
# download
774
-
log "- ${tty_magenta}download${tty_reset} lando ${tty_bold}${HRV}${tty_reset} to ${tty_bold}${DEST}${tty_reset}"
787
+
if [[ $URL!= file://* ]];then log "- ${tty_magenta}download${tty_reset} lando ${tty_bold}${HRV}${tty_reset} to ${tty_bold}${DEST}${tty_reset}"
788
+
# or move
789
+
else log "- ${tty_magenta}move${tty_reset} lando ${tty_bold}${ORIGINAL_VERSION}${tty_reset} to ${tty_bold}${DEST}${tty_reset}";fi
775
790
# setup
776
791
if [[ "$SETUP"=="1" ]];then log "- ${tty_blue}run${tty_reset}${tty_bold}lando setup${tty_reset}";fi
777
792
# shellenv
@@ -786,14 +801,14 @@ if needs_sudo; then
786
801
execute_sudo true
787
802
fi
788
803
789
-
# Create directories if we need to
790
-
if [[ !-d"$DEST" ]];then auto_exec mkdir -p "$DEST";fi
791
-
if [[ !-d"$LANDO_TMPDIR" ]];then auto_exec mkdir -p "$LANDO_TMPDIR";fi
792
-
793
804
# LANDO
794
805
LANDO="${DEST}/lando"
795
806
LANDO_TMPFILE="${LANDO_TMPDIR}/${RANDOM}"
796
807
808
+
# Create directories if we need to
809
+
if [[ !-d"$DEST" ]];then auto_exec mkdir -p "$DEST";fi
810
+
if [[ !-d"$LANDO_TMPDIR" ]];then auto_exec mkdir -p "$LANDO_TMPDIR";fi
811
+
797
812
# download lando
798
813
log "${tty_magenta}downloading${tty_reset}${tty_bold}${URL}${tty_reset} to ${tty_bold}${LANDO}${tty_reset}"
799
814
auto_exec curl \
@@ -811,13 +826,21 @@ execute "${LANDO_TMPFILE}" version >/dev/null
811
826
# NOTE: we use mv here instead of cp because of https://developer.apple.com/forums/thread/130313
812
827
auto_exec mv -f "${LANDO_TMPFILE}""${LANDO}"
813
828
814
-
# if lando 3 then --clear
829
+
# if lando 3 then we need to do some other cleanup things
830
+
# @TODO: is there an equivalent on lando 4?
815
831
if [[ $LMV=='3' ]];then
816
-
execute "${LANDO}" --clear >/dev/null
832
+
# ensure dirz
833
+
execute mkdir -p "$HOME/.lando/bin"
834
+
# force symlink landobin to ensure PATH primacy as best we can
835
+
execute ln -sf "${LANDO}""$HOME/.lando/bin/lando"
836
+
# remove preexisting lando core so this one can also assert primacy
837
+
execute rm -rf "$HOME/.lando/plugins/@lando/core"
838
+
# clean
839
+
execute "${LANDO}" --clear >/dev/null;
817
840
fi
818
841
819
842
# test via log
820
-
log "${tty_green}downloaded${tty_reset}@lando/cli${tty_bold}$("${LANDO}" version --component @lando/cli)${tty_reset} to ${tty_bold}${LANDO}${tty_reset}"
843
+
log "${tty_green}downloaded${tty_reset} lando ${tty_bold}$("${LANDO}" version --component @lando/cli)${tty_reset} to ${tty_bold}${LANDO}${tty_reset}"
0 commit comments