Skip to content

Commit

Permalink
release v3.6.1 generated by @lando/prepare-release-action
Browse files Browse the repository at this point in the history
  • Loading branch information
rtfm-47 committed Nov 27, 2024
1 parent 48214f8 commit ae87eec
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 35 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

## v3.6.1 - [November 27, 2024](https://github.com/lando/setup-lando/releases/tag/v3.6.1)

* Added some `circleci` tests
* Fixed various permissions related bugs for `POSIX` installs

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46569,7 +46569,7 @@ var __webpack_exports__ = {};
"use strict";


const SCRIPT_VERSION = 'v3.6.0';
const SCRIPT_VERSION = 'v3.6.1';

const core = __nccwpck_require__(7484);
const exec = __nccwpck_require__(5236);
Expand Down
2 changes: 1 addition & 1 deletion dist/setup-lando.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if ($env:LANDO_VERSION -ne $null -and $env:LANDO_VERSION -ne "" -and $Version -e
$Version = $env:LANDO_VERSION
}

$SCRIPT_VERSION = "v3.6.0"
$SCRIPT_VERSION = "v3.6.1"
$LANDO_DEFAULT_MV = "3"
$LANDO_SETUP_PS1_URL = "https://get.lando.dev/setup-lando.ps1"
$LANDO_SETUP_SH_URL = "https://get.lando.dev/setup-lando.sh"
Expand Down
111 changes: 80 additions & 31 deletions dist/setup-lando.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SCRIPT_VERSION="v3.6.0"
SCRIPT_VERSION="v3.6.1"
#!/bin/bash
set -u
# Lando POSIX setup script.
Expand Down Expand Up @@ -799,18 +799,73 @@ wait_for_user() {
fi
}

# determine the exec we need for sudo protected things
# we add /tmp in here because their are high security environments where /tmp is not universally writable
if needs_sudo; then
debug "auto_exec elevating to sudo"
auto_exec() {
execute_sudo "$@"
}
else
auto_exec() {
execute "$@"
}
fi
# helpers for more itemized sudoing
auto_link() {
local source="$1"
local dest="$2"
local perm_source
local perm_dest
perm_source="$(find_first_existing_parent "$source")"
perm_dest="$(find_first_existing_parent "$dest")"

if have_sudo_access && [[ ! -w "$perm_source" || ! -w "$perm_dest" ]]; then
execute_sudo ln -sf "$source" "$dest"
else
execute ln -sf "$source" "$dest"
fi
}

auto_mkdirp() {
local dir="$1"
local perm_dir
perm_dir="$(find_first_existing_parent "$dir")"

if have_sudo_access && [[ ! -w "$perm_dir" ]]; then
execute_sudo mkdir -p "$dir"
else
execute mkdir -p "$dir"
fi
}

auto_mv() {
local source="$1"
local dest="$2"
local perm_source
local perm_dest
perm_source="$(find_first_existing_parent "$source")"
perm_dest="$(find_first_existing_parent "$dest")"

if have_sudo_access && [[ ! -w "$perm_source" || ! -w "$perm_dest" ]]; then
execute_sudo mv -f "$source" "$dest"
else
execute mv -f "$source" "$dest"
fi
}

auto_curl_n_x() {
local dest="$1"
local url="$2"
local perm_dir
perm_dir="$(find_first_existing_parent "$dest")"

if have_sudo_access && [[ ! -w "$perm_dir" ]]; then
execute_sudo curl \
--fail \
--location \
--progress-bar \
--output "$dest" \
"$url"
execute_sudo chmod +x "$dest"
else
execute curl \
--fail \
--location \
--progress-bar \
--output "$dest" \
"$url"
execute chmod +x "$dest"
fi
}

# Invalidate sudo timestamp before exiting (if it wasn't active before).
if [[ -x /usr/bin/sudo ]] && ! /usr/bin/sudo -n -v 2>/dev/null; then
Expand Down Expand Up @@ -847,37 +902,31 @@ if needs_sudo; then
fi

# Create directories if we need to
if [[ ! -d "$DEST" ]]; then auto_exec mkdir -p "$DEST"; fi
if [[ ! -d "$LANDO_TMPDIR" ]]; then auto_exec mkdir -p "$LANDO_TMPDIR"; fi
if [[ ! -d "$LANDO_BINDIR" ]]; then execute mkdir -p "$LANDO_BINDIR"; fi
if [[ ! -d "$DEST" ]]; then auto_mkdirp "$DEST"; fi
if [[ ! -d "$LANDO_TMPDIR" ]]; then auto_mkdirp "$LANDO_TMPDIR"; fi
if [[ ! -d "$LANDO_BINDIR" ]]; then auto_mkdirp "$LANDO_BINDIR"; fi

# download lando
log "${tty_magenta}downloading${tty_reset} ${tty_bold}${URL}${tty_reset} to ${tty_bold}${LANDO}${tty_reset}"
auto_exec curl \
--fail \
--location \
--progress-bar \
--output "$LANDO_TMPFILE" \
"$URL"

# make executable and weak "it works" test
auto_exec chmod +x "${LANDO_TMPFILE}"
auto_curl_n_x "$LANDO_TMPFILE" "$URL"

# weak "it works" test
execute "${LANDO_TMPFILE}" version >/dev/null

# if dest = symlinker then we need to actually mv 2 LANDO_DATADIR
# NOTE: we use mv here instead of cp because of https://developer.apple.com/forums/thread/130313
if [[ "$LANDO" == "$SYMLINKER" ]]; then
execute mkdir -p "${LANDO_DATADIR}/${VERSION}"
execute mv -f "$LANDO_TMPFILE" "$HIDDEN_LANDO"
execute ln -sf "$HIDDEN_LANDO" "$SYMLINKER"
auto_mkdirp "${LANDO_DATADIR}/${VERSION}"
auto_mv "$LANDO_TMPFILE" "$HIDDEN_LANDO"
auto_link "$HIDDEN_LANDO" "$SYMLINKER"
else
auto_exec mv -f "$LANDO_TMPFILE" "$LANDO"
auto_exec ln -sf "$LANDO" "$SYMLINKER"
auto_mv "$LANDO_TMPFILE" "$LANDO"
auto_link "$LANDO" "$SYMLINKER"
fi

# hook up the syslink here
if [[ "$SYSLINK" == "1" ]]; then
auto_exec ln -sf "$SYMLINKER" "$SYSLINKER"
auto_link "$SYMLINKER" "$SYSLINKER"
fi

# if lando 3 then we need to do some other cleanup things
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@lando/setup-lando",
"description": "GitHub Action to setup Lando on GitHub Actions.",
"version": "3.6.0",
"version": "3.6.1",
"author": "Mike Pirog @pirog",
"main": "setup-lando.js",
"license": "GPL-3.0",
Expand Down

0 comments on commit ae87eec

Please sign in to comment.