@@ -29,7 +29,7 @@ function update_script() {
2929 fi
3030
3131 RELEASE=$( curl -fsSL https://api.github.com/repos/babybuddy/babybuddy/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
32- if [[ ! -f /opt/ ${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/babybuddy_version.txt ) " ]]; then
32+ if [[ " ${RELEASE} " != " $( cat ~ /.babybuddy 2> /dev/null ) " ]] || [[ ! -f ~ /.babybuddy ]]; then
3333 setup_uv
3434
3535 msg_info " Stopping Services"
@@ -42,17 +42,14 @@ function update_script() {
4242 find . -mindepth 1 -maxdepth 1 ! -name ' .venv' -exec rm -rf {} +
4343 msg_ok " Cleaned old files"
4444
45+ fetch_and_deploy_gh_release " babybuddy" " babybuddy/babybuddy"
46+
4547 msg_info " Updating ${APP} to v${RELEASE} "
46- temp_file=$( mktemp)
47- curl -fsSL " https://github.com/babybuddy/babybuddy/archive/refs/tags/v${RELEASE} .tar.gz" -o " $temp_file "
4848 cd /opt/babybuddy
49- tar zxf " $temp_file " --strip-components=1 -C /opt/babybuddy
5049 mv /tmp/production.py.bak babybuddy/settings/production.py
51- cd /opt/babybuddy
5250 source .venv/bin/activate
5351 $STD uv pip install -r requirements.txt
5452 $STD python manage.py migrate
55- echo " ${RELEASE} " > /opt/${APP} _version.txt
5653 msg_ok " Updated ${APP} to v${RELEASE} "
5754
5855 msg_info " Fixing permissions"
@@ -66,9 +63,6 @@ function update_script() {
6663 systemctl start nginx
6764 msg_ok " Services Started"
6865
69- msg_info " Cleaning up"
70- rm -f " $temp_file "
71- msg_ok " Cleaned"
7266 msg_ok " Updated Successfully"
7367 else
7468 msg_ok " No update required. ${APP} is already at v${RELEASE} "
0 commit comments