diff options
author | YISH <mokeyish@hotmail.com> | 2022-04-27 11:30:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 23:30:29 -0400 |
commit | af09136b95486e41ebd458e5209fd53a3b308447 (patch) | |
tree | c6d4682b9403f6006487756eeb7e93d77178634f /contrib | |
parent | 5651c650c09accbb01bfe21e268f7d289a3b5d19 (diff) | |
download | gitea-af09136b95486e41ebd458e5209fd53a3b308447.tar.gz gitea-af09136b95486e41ebd458e5209fd53a3b308447.zip |
Fix `upgrade.sh` script error with `su -c` (#19483)
* Fix scirpt err with `su -c`, add env auto loading.
* Update upgrade.sh
* Update upgrade.sh
* Update contrib/upgrade.sh
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/upgrade.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/upgrade.sh b/contrib/upgrade.sh index 9a5e903b6b..3a98c277d6 100755 --- a/contrib/upgrade.sh +++ b/contrib/upgrade.sh @@ -24,7 +24,8 @@ function giteacmd { if [[ $sudocmd = "su" ]]; then - "$sudocmd" - "$giteauser" -c "$giteabin" --config "$giteaconf" --work-path "$giteahome" "$@" + # `-c` only accept one string as argument. + "$sudocmd" - "$giteauser" -c "$(printf "%q " "$giteabin" "--config" "$giteaconf" "--work-path" "$giteahome" "$@")" else "$sudocmd" --user "$giteauser" "$giteabin" --config "$giteaconf" --work-path "$giteahome" "$@" fi |