This commit is contained in:
Slaviša Arežina
2025-07-09 10:53:35 +02:00
committed by GitHub
parent 96a8f9df89
commit 0e2c793f92
2 changed files with 7 additions and 23 deletions

View File

@ -28,20 +28,16 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
RELEASE=$(curl -fsSL https://api.github.com/repos/excalidraw/excalidraw/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/excalidraw/excalidraw/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/excalidraw_version.txt)" ]] || [[ ! -f /opt/excalidraw_version.txt ]]; then if [[ "${RELEASE}" != "$(cat ~/.excalidraw 2>/dev/null)" ]] || [[ ! -f ~/.excalidraw ]]; then
msg_info "Stopping $APP" msg_info "Stopping $APP"
systemctl stop excalidraw systemctl stop excalidraw
msg_ok "Stopped $APP" msg_ok "Stopped $APP"
msg_info "Updating $APP to v${RELEASE}"
cd /tmp
temp_file=$(mktemp)
curl -fsSL "https://github.com/excalidraw/excalidraw/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
tar xzf $temp_file
rm -rf /opt/excalidraw rm -rf /opt/excalidraw
mv excalidraw-${RELEASE} /opt/excalidraw fetch_and_deploy_gh_release "excalidraw" "excalidraw/excalidraw"
msg_info "Updating $APP to v${RELEASE}"
cd /opt/excalidraw cd /opt/excalidraw
$STD yarn $STD yarn
msg_ok "Updated $APP to v${RELEASE}" msg_ok "Updated $APP to v${RELEASE}"
@ -50,11 +46,6 @@ function update_script() {
systemctl start excalidraw systemctl start excalidraw
msg_ok "Started $APP" msg_ok "Started $APP"
msg_info "Cleaning Up"
rm -rf $temp_file
msg_ok "Cleanup Completed"
echo "${RELEASE}" >/opt/excalidraw_version.txt
msg_ok "Update Successful" msg_ok "Update Successful"
else else
msg_ok "No update required. ${APP} is already at v${RELEASE}" msg_ok "No update required. ${APP} is already at v${RELEASE}"

View File

@ -14,21 +14,15 @@ network_check
update_os update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt-get install -y xdg-utils
xdg-utils
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
fetch_and_deploy_gh_release "excalidraw" "excalidraw/excalidraw"
msg_info "Setup Excalidraw" msg_info "Configuring Excalidraw"
temp_file=$(mktemp)
RELEASE=$(curl -fsSL https://api.github.com/repos/excalidraw/excalidraw/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
curl -fsSL "https://github.com/excalidraw/excalidraw/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
tar xzf $temp_file
mv excalidraw-${RELEASE} /opt/excalidraw
cd /opt/excalidraw cd /opt/excalidraw
$STD yarn $STD yarn
echo "${RELEASE}" >/opt/excalidraw_version.txt
msg_ok "Setup Excalidraw" msg_ok "Setup Excalidraw"
msg_info "Creating Service" msg_info "Creating Service"
@ -53,7 +47,6 @@ motd_ssh
customize customize
msg_info "Cleaning up" msg_info "Cleaning up"
rm -f $temp_file
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
msg_ok "Cleaned" msg_ok "Cleaned"