Fix Manyfold Ruby setup home initialization

Create the `manyfold` service user before calling `setup_ruby` so `/home/manyfold` exists when rbenv profile snippets are written. Also harden `setup_ruby` by creating `$HOME` if missing, preventing profile-write failures for installers that pass a home directory before creating the user.
This commit is contained in:
MickLesk
2026-07-18 12:05:20 +02:00
parent 6cb0fbbc39
commit d13075a5e1
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -8637,6 +8637,11 @@ setup_ruby() {
local BASHRC_FILE="$HOME/.bashrc"
local TMP_DIR=$(mktemp -d)
# Ensure HOME exists: callers may pass a not-yet-created home (e.g. a service
# user that is created later in the install), so the profile writes below do
# not fail on a missing directory.
mkdir -p "$HOME"
if ! grep -q 'rbenv init' "$PROFILE_FILE" 2>/dev/null; then
cat <<'EOF' >>"$PROFILE_FILE"
export PATH="$HOME/.rbenv/bin:$PATH"