Skip to content

Commit 6ad1ea0

Browse files
authored
Open WebUI: reset code base before pulling update (#2948)
* fix: hard reset codebase before pulling * backup data folder just in case * bad path fix * another safety layer * final touches * i'm dumb
1 parent a640814 commit 6ad1ea0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ct/openwebui.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ function update_script() {
2929
fi
3030
msg_info "Updating ${APP} (Patience)"
3131
cd /opt/open-webui
32+
mkdir /opt/open-webui-backup
33+
cp -rf /opt/open-webui/backend/data /opt/open-webui-backup
34+
git add -A
35+
$STD git stash
36+
$STD git reset --hard
3237
output=$(git pull --no-rebase)
3338
if echo "$output" | grep -q "Already up to date."; then
3439
msg_ok "$APP is already up to date."
@@ -40,6 +45,8 @@ function update_script() {
4045
$STD npm run build
4146
cd ./backend
4247
$STD pip install -r requirements.txt -U
48+
cp -rf /opt/open-webui-backup/* /opt/open-webui/backend
49+
$STD git stash pop
4350
systemctl start open-webui.service
4451
msg_ok "Updated Successfully"
4552
exit

0 commit comments

Comments
 (0)