mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 20:04:32 +01:00
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>
This commit is contained in:
parent
5651c650c0
commit
af09136b95
1 changed files with 2 additions and 1 deletions
|
@ -24,7 +24,8 @@
|
||||||
|
|
||||||
function giteacmd {
|
function giteacmd {
|
||||||
if [[ $sudocmd = "su" ]]; then
|
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
|
else
|
||||||
"$sudocmd" --user "$giteauser" "$giteabin" --config "$giteaconf" --work-path "$giteahome" "$@"
|
"$sudocmd" --user "$giteauser" "$giteabin" --config "$giteaconf" --work-path "$giteahome" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue