Skip to content

Commit

Permalink
release v3.0.2 generated by @lando/prepare-release-action
Browse files Browse the repository at this point in the history
  • Loading branch information
rtfm-47 committed Apr 5, 2024
1 parent f3fa8e2 commit 9606a79
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47835,7 +47835,7 @@ var __webpack_exports__ = {};
"use strict";


const SCRIPT_VERSION = 'v3.0.1';
const SCRIPT_VERSION = 'v3.0.2';

const core = __nccwpck_require__(2186);
const exec = __nccwpck_require__(1514);
Expand Down
24 changes: 15 additions & 9 deletions dist/setup-lando.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SCRIPT_VERSION="v3.0.1"
SCRIPT_VERSION="v3.0.2"
#!/bin/bash
set -u
# Lando POSIX setup script.
Expand Down Expand Up @@ -551,6 +551,14 @@ fi
PERM_DIR="$(find_first_existing_parent "$DEST")"
debug "resolved install destination ${DEST} to a perm check on ${PERM_DIR}"

needs_sudo() {
if [[ ! -w "$PERM_DIR" ]] || [[ ! -w "/tmp" ]]; then
return 0;
else
return 1;
fi
}

####################################################################### pre-script errors

# abort if run as root
Expand All @@ -560,7 +568,7 @@ if [[ "${EUID:-${UID}}" == "0" ]]; then
fi

# abort if dir
if [[ ! -w "$PERM_DIR" ]] && ! have_sudo_access; then
if needs_sudo && ! have_sudo_access; then
abort_multi "$(cat <<EOABORT
${tty_bold}${USER}${tty_reset} cannot write to ${tty_red}${DEST}${tty_reset} and is not a ${tty_bold}sudo${tty_reset} user!
Rerun setup with a sudoer or use --dest to install to a directory ${tty_bold}${USER}${tty_reset} can write to.
Expand Down Expand Up @@ -726,17 +734,15 @@ wait_for_user() {
echo "Press ${tty_bold}RETURN${tty_reset}/${tty_bold}ENTER${tty_reset} to continue or any other key to abort:"
getc c
# we test for \r and \n because some stuff does \r instead
if ! [[ "${c}" == $'\r' || "${c}" == $'\n' ]]
then
if ! [[ "${c}" == $'\r' || "${c}" == $'\n' ]]; then
exit 1
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 [[ ! -w "$PERM_DIR" ]] || [[ ! -w "/tmp" ]]; then
debug "auto_exec elevating to sudo because ${USER} cannot write to ${PERM_DIR} or /tmp"
if needs_sudo; then
debug "auto_exec elevating to sudo"
auto_exec() {
execute_sudo "$@"
}
Expand All @@ -760,7 +766,7 @@ if [[ -z "${NONINTERACTIVE-}" ]]; then
log "${tty_bold}this script is about to:${tty_reset}"
log
# sudo prompt
if [[ ! -w "$PERM_DIR" ]]; then log "- ${tty_green}prompt${tty_reset} for ${tty_bold}sudo${tty_reset} password"; fi
if needs_sudo; then log "- ${tty_green}prompt${tty_reset} for ${tty_bold}sudo${tty_reset} password"; fi
# download
log "- ${tty_magenta}download${tty_reset} lando ${tty_bold}${HRV}${tty_reset} to ${tty_bold}${DEST}${tty_reset}"
# setup
Expand All @@ -774,7 +780,7 @@ if [[ -z "${NONINTERACTIVE-}" ]]; then
fi

# flag for password here if needed
if [[ ! -w "$PERM_DIR" ]]; then
if needs_sudo; then
log "please enter ${tty_bold}sudo${tty_reset} password:"
execute_sudo true
fi
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.0.1",
"version": "3.0.2",
"author": "Mike Pirog @pirog",
"main": "setup-lando.js",
"license": "GPL-3.0",
Expand Down

0 comments on commit 9606a79

Please sign in to comment.