From aac02578dee251845ec768a2eeb83a7355deb4ac Mon Sep 17 00:00:00 2001 From: Mohammed <99575128+GITTYCAT12@users.noreply.github.com> Date: Tue, 1 Sep 2026 02:08:15 +0530 Subject: [PATCH 1/2] setup.sh: make submodule checks independent of working directory --- setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 23bb820f04..ba3259c4c8 100755 --- a/setup.sh +++ b/setup.sh @@ -19,13 +19,13 @@ tmpfile=$(mktemp) # any error messages from this command will stand out # more clearly when run as a separate command rather than # being piped -git submodule status --recursive > "$tmpfile" +git -C "$DIR" submodule status --recursive > "$tmpfile" if grep -q "^-" "$tmpfile"; then if [[ "$OSTYPE" == "darwin"* ]]; then - git submodule update --init --recursive + git -C "$DIR" submodule update --init --recursive else - sudo -u $SUDO_USER git submodule update --init --recursive + sudo -u $SUDO_USER git -C "$DIR" submodule update --init --recursive fi elif grep -q "^+" "$tmpfile"; then # Make it easy for users who are not hacking ORFS to do the right thing, From 6636f66a70d1669a51d68adfac2448d557194b96 Mon Sep 17 00:00:00 2001 From: Mohammed <99575128+GITTYCAT12@users.noreply.github.com> Date: Tue, 1 Sep 2026 02:10:05 +0530 Subject: [PATCH 2/2] setup.sh: handle unset SUDO_USER safely --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index ba3259c4c8..2eed221d8b 100755 --- a/setup.sh +++ b/setup.sh @@ -25,7 +25,7 @@ if grep -q "^-" "$tmpfile"; then if [[ "$OSTYPE" == "darwin"* ]]; then git -C "$DIR" submodule update --init --recursive else - sudo -u $SUDO_USER git -C "$DIR" submodule update --init --recursive + sudo -u "${SUDO_USER:-root}" git -C "$DIR" submodule update --init --recursive fi elif grep -q "^+" "$tmpfile"; then # Make it easy for users who are not hacking ORFS to do the right thing, @@ -51,5 +51,5 @@ fi if [[ "$OSTYPE" == "darwin"* ]]; then "$DIR/etc/DependencyInstaller.sh" -common -prefix="$DIR/dependencies" else - sudo -u $SUDO_USER "$DIR/etc/DependencyInstaller.sh" -common -prefix="$DIR/dependencies" + sudo -u "${SUDO_USER:-root}" "$DIR/etc/DependencyInstaller.sh" -common -prefix="$DIR/dependencies" fi