From 4888c33e4bf9d2c333e3a1e7baccd7842608b07c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:59:52 +0100 Subject: [PATCH] [Fix]: Fixed rm Bug in pf2etools (#1292) * [Fix]: Fixed rm Bug in pf2etools * Update pf2etools.sh --- ct/pf2etools.sh | 9 ++++----- install/pf2etools-install.sh | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ct/pf2etools.sh b/ct/pf2etools.sh index 4d2205e8..967c407d 100644 --- a/ct/pf2etools.sh +++ b/ct/pf2etools.sh @@ -45,15 +45,14 @@ function update_script() { # Execute Update msg_info "Updating ${APP}" - cd "/opt/${APP}" + cd /opt wget -q "https://github.com/Pf2eToolsOrg/Pf2eTools/archive/refs/tags/${RELEASE}.zip" - unzip -q "${RELEASE}.zip" + unzip -q ${RELEASE}.zip rm -rf "/opt/${APP}" - mv "${APP}-${RELEASE:1}" "/opt/${APP}" + mv ${APP}-${RELEASE:1} /opt/${APP} cd /opt/Pf2eTools $STD npm install $STD npm run build - cd ~ echo "${RELEASE}" >"/opt/${APP}_version.txt" msg_ok "Updated ${APP}" @@ -62,7 +61,7 @@ function update_script() { # Cleaning up msg_info "Cleaning Up" - rm -rf /opt/${APP}/${RELEASE}.zip + rm -rf /opt/${RELEASE}.zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleanup Completed" diff --git a/install/pf2etools-install.sh b/install/pf2etools-install.sh index fda5e8f0..d7e7c312 100644 --- a/install/pf2etools-install.sh +++ b/install/pf2etools-install.sh @@ -38,6 +38,7 @@ msg_ok "Installed Node.js" # Setup App msg_info "Setup Pf2eTools" +cd /opt RELEASE=$(curl -s https://api.github.com/repos/Pf2eToolsOrg/Pf2eTools/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') wget -q "https://github.com/Pf2eToolsOrg/Pf2eTools/archive/refs/tags/${RELEASE}.zip" unzip -q "${RELEASE}.zip" @@ -65,7 +66,7 @@ msg_ok "Created Service" # Cleanup msg_info "Cleaning up" -rm "${RELEASE}.zip" +rm -rf /opt/${RELEASE}.zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"