1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Address case where user is already arsse

This commit is contained in:
J. King 2024-01-10 11:00:08 -05:00
parent b1154359e4
commit 8834a65e4c
3 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,4 @@
Version 0.10.5 (2024-01-09) Version 0.10.5 (2024-01-10)
=========================== ===========================
Changes: Changes:

View file

@ -517,7 +517,7 @@ class RoboFile extends \Robo\Tasks {
} elseif (in_array("item", $expected) && preg_match('/^- (\w.*)$/D', $l, $m)) { } elseif (in_array("item", $expected) && preg_match('/^- (\w.*)$/D', $l, $m)) {
$entry[$section][] = $m[1]; $entry[$section][] = $m[1];
$expected = ["item", "continuation", "blank line"]; $expected = ["item", "continuation", "blank line"];
} elseif (in_array("continuation", $expected) && preg_match('/^ (\w.*)$/D', $l, $m)) { } elseif (in_array("continuation", $expected) && preg_match('/^ (\S.*)$/D', $l, $m)) {
$last = sizeof($entry[$section]) - 1; $last = sizeof($entry[$section]) - 1;
$entry[$section][$last] .= "\n".$m[1]; $entry[$section][$last] .= "\n".$m[1];
} else { } else {

6
dist/arch/arsse vendored
View file

@ -11,13 +11,15 @@ check_sudo() {
} }
# allow overriding the php executable # allow overriding the php executable
if [[ -n "${ARSSE_PHP}" ]] && command -v "${ARSSE_PHP}" > /dev/null; then if [ -n "${ARSSE_PHP}" ] && command -v "${ARSSE_PHP}" > /dev/null; then
php="${ARSSE_PHP}" php="${ARSSE_PHP}"
else else
php="${default_php}" php="${default_php}"
fi fi
if [[ "${UID}" -eq 0 ]]; then if [ "$(whoami)" = "arsse" ]; then
"$php" /usr/share/webapps/arsse/arsse "$@"
elif [ "${UID}" -eq 0 ]; then
runuser -u "arsse" -- "$php" /usr/share/webapps/arsse/arsse "$@" runuser -u "arsse" -- "$php" /usr/share/webapps/arsse/arsse "$@"
else else
check_sudo check_sudo