Skip to content

Commit e041a0c

Browse files
committed
setup - fix up warnings with git 2.34.1 in retropie-setup
Git reports fatal: unsafe repository ('$HOME/RetroPie-Setup' is owned by someone else) This is due to us running `git log` under root on a repo owned by the user it was installed for. This commit also switches from su to sudo in setup.sh for consistency with other code.
1 parent 6e83a7d commit e041a0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scriptmodules/admin/setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function rps_logInit() {
3838

3939
function rps_logStart() {
4040
echo -e "Log started at: $(date -d @$time_start)\n"
41-
echo "RetroPie-Setup version: $__version ($(git -C "$scriptdir" log -1 --pretty=format:%h))"
41+
echo "RetroPie-Setup version: $__version ($(sudo -u "$user" git -C "$scriptdir" log -1 --pretty=format:%h))"
4242
echo "System: $__platform ($__platform_arch) - $__os_desc - $(uname -a)"
4343
}
4444

@@ -120,7 +120,7 @@ function updatescript_setup()
120120
return 1
121121
fi
122122
local error
123-
if ! error=$(su $user -c "git pull --ff-only 2>&1 >/dev/null"); then
123+
if ! error=$(sudo -u "$user" git pull --ff-only 2>&1 >/dev/null); then
124124
printMsgs "dialog" "Update failed:\n\n$error"
125125
popd >/dev/null
126126
return 1
@@ -680,7 +680,7 @@ function gui_setup() {
680680
depends_setup
681681
local default
682682
while true; do
683-
local commit=$(git -C "$scriptdir" log -1 --pretty=format:"%cr (%h)")
683+
local commit=$(sudo -u "$user" git -C "$scriptdir" log -1 --pretty=format:"%cr (%h)")
684684

685685
cmd=(dialog --backtitle "$__backtitle" --title "RetroPie-Setup Script" --cancel-label "Exit" --item-help --help-button --default-item "$default" --menu "Version: $__version - Last Commit: $commit\nSystem: $__platform ($__platform_arch) - running on $__os_desc" 22 76 16)
686686
options=(

0 commit comments

Comments
 (0)