Skip to content

Commit b293638

Browse files
authored
Fix: file replacement in Watcharr Update Script (#2498)
1 parent d1e0c2d commit b293638

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ct/watcharr.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ function update_script() {
3737

3838
msg_info "Updating $APP to v${RELEASE}"
3939
temp_file=$(mktemp)
40+
temp_folder=$(mktemp -d)
4041
wget -q "https://github.com/sbondCo/Watcharr/archive/refs/tags/v${RELEASE}.tar.gz" -O "$temp_file"
41-
tar -xzf "$temp_file"
42+
tar -xzf "$temp_file" -C "$temp_folder"
4243
rm -f /opt/watcharr/server/watcharr
4344
rm -rf /opt/watcharr/server/ui
44-
mv Watcharr-${RELEASE}/ /opt/watcharr
45+
cp -rf ${temp_folder}/Watcharr-${RELEASE}/* /opt/watcharr
4546
cd /opt/watcharr
4647
export GOOS=linux
4748
npm i &> /dev/null
@@ -58,6 +59,7 @@ function update_script() {
5859

5960
msg_info "Cleaning Up"
6061
rm -f ${temp_file}
62+
rm -rf ${temp_folder}
6163
msg_ok "Cleanup Completed"
6264

6365
echo "${RELEASE}" >/opt/${APP}_version.txt

0 commit comments

Comments
 (0)