Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
Use our server for releases json instead of github APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
GuLinux committed Nov 21, 2019
1 parent caf3f80 commit 6f4430d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions config/debian_based/astrophotoplus-deb-updater
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

RELEASES_URL="https://api.github.com/repos/GuLinux/AstroPhoto-Plus/releases"
RELEASES_URL="https://astrophotoplus.gulinux.net/releases"

get-installed-version() {
dpkg-query --showformat='${Version}' --show astrophotoplus
Expand Down Expand Up @@ -45,7 +45,6 @@ if latest.startswith('AstroPhotoPlus-{}'.format(current_version)):
print('is_latest')
else:
print('needs_update')
EOF
}

Expand All @@ -71,15 +70,29 @@ update() {
fi
}

check-update-available() {
latest_deb="$( get-latest-deb )"
echo "Latest version: $(basename "$latest_deb" )" >&2
echo "Current version: $( get-installed-version )" >&2
if [ "$(needs-update "$latest_deb")" == "is_latest" ]; then
exit 1
else
exit 0
fi
}

case "$1" in
update)
update
;;
get-latest-info)
get-latest-info
;;
check-update-available)
check-update-available
;;
*)
echo "Usage: $0 update|get-latest-info" >&1
echo "Usage: $0 update|get-latest-info|check-update-available" >&1
exit 1
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion config/debian_based/commands.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "Update AstroPhoto Plus",
"arguments": ["sudo", "${CMAKE_INSTALL_PREFIX}/share/AstroPhotoPlus/config/debian_based/astrophotoplus-deb-updater", "update"],
"category": "Updates",
"check": ["${CMAKE_INSTALL_PREFIX}/share/AstroPhotoPlus/config/debian_based/astrophotoplus-deb-updater", "get-latest-info"],
"check": ["sudo", "${CMAKE_INSTALL_PREFIX}/share/AstroPhotoPlus/config/debian_based/astrophotoplus-deb-updater", "check-update-available"],
"confirmation_message": "This will restart AstroPhotoPlus, and any job in progress. Are you sure?",
"ui_properties": {
"icon": "sync"
Expand Down

0 comments on commit 6f4430d

Please sign in to comment.