Skip to content

Commit 4aa8578

Browse files
authored
Fix TriliumNotes release handling (#3160)
1 parent 58132fd commit 4aa8578

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ct/trilium.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ function update_script() {
2828
exit
2929
fi
3030
if [[ ! -f /opt/${APP}_version.txt ]]; then touch /opt/${APP}_version.txt; fi
31-
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
32-
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
31+
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
32+
if [[ "v${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
3333
msg_info "Stopping ${APP}"
3434
systemctl stop trilium
3535
sleep 1
@@ -40,11 +40,11 @@ function update_script() {
4040
mv /opt/trilium/{db,dump-db} /opt/trilium_backup/
4141
rm -rf /opt/trilium
4242
cd /tmp
43-
wget -q https://github.com/TriliumNext/Notes/releases/download/${RELEASE}/TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz
44-
tar -xf TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz
43+
wget -q https://github.com/TriliumNext/Notes/releases/download/v${RELEASE}/TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz
44+
tar -xf TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz
4545
mv TriliumNextNotes-Server-$RELEASE-linux-x64 /opt/trilium
4646
cp -r /opt/trilium_backup/{db,dump-db} /opt/trilium/
47-
echo "${RELEASE}" >/opt/${APP}_version.txt
47+
echo "v${RELEASE}" >/opt/${APP}_version.txt
4848
msg_ok "Updated to ${RELEASE}"
4949

5050
msg_info "Cleaning up"

install/trilium-install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ msg_ok "Installed Dependencies"
2222

2323
msg_info "Setup TriliumNext"
2424
cd /opt
25-
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
26-
wget -q https://github.com/TriliumNext/Notes/releases/download/${RELEASE}/TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz
27-
tar -xf TriliumNextNotes-Server-${RELEASE}-linux-x64.tar.xz
25+
RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
26+
wget -q https://github.com/TriliumNext/Notes/releases/download/v${RELEASE}/TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz
27+
tar -xf TriliumNextNotes-Server-v${RELEASE}-linux-x64.tar.xz
2828
mv TriliumNextNotes-Server-$RELEASE-linux-x64 /opt/trilium
2929
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
3030
msg_ok "Setup TriliumNext"

0 commit comments

Comments
 (0)