mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-12-21 23:31:52 +01:00
Update NonSteamLaunchers.sh
~new updater
This commit is contained in:
parent
3ec585ea50
commit
9ebebe13a5
@ -18,13 +18,19 @@ check_for_updates() {
|
|||||||
# Display a Zenity window to notify the user that a new version is available
|
# Display a Zenity window to notify the user that a new version is available
|
||||||
zenity --info --text="A new version is available: $latest_version\nPlease download it from GitHub." --width=200 --height=100
|
zenity --info --text="A new version is available: $latest_version\nPlease download it from GitHub." --width=200 --height=100
|
||||||
else
|
else
|
||||||
# Set the URL to the raw content of the script on GitHub
|
# Set the username, repository, branch, and path to file
|
||||||
local raw_url=$(curl -s "$api_url" | grep '"tarball_url":' | sed -E 's/.*"([^"]+)".*/\1/')
|
local username="moraroy"
|
||||||
|
local repository="NonSteamLaunchers-On-Steam-Deck"
|
||||||
|
local branch="main"
|
||||||
|
local path_to_file="NonSteamLaunchers.sh"
|
||||||
|
|
||||||
# Download the latest version of the script from GitHub
|
# Construct the raw URL
|
||||||
curl -Ls "$raw_url" | tar -xzO --wildcards "*/script.sh" > /tmp/latest_script.sh
|
local raw_url="https://raw.githubusercontent.com/$username/$repository/$branch/$path_to_file"
|
||||||
|
|
||||||
# Compare the latest version of the script against the local version
|
# Download the latest version of the file from GitHub
|
||||||
|
curl -s "$raw_url" -o /tmp/latest_script.sh
|
||||||
|
|
||||||
|
# Compare the latest version of the file against the local version
|
||||||
if ! cmp -s "$0" /tmp/latest_script.sh; then
|
if ! cmp -s "$0" /tmp/latest_script.sh; then
|
||||||
# Display a Zenity window to notify the user that a new version is available
|
# Display a Zenity window to notify the user that a new version is available
|
||||||
zenity --info --text="A new version is available\nPlease download it from GitHub." --width=200 --height=100
|
zenity --info --text="A new version is available\nPlease download it from GitHub." --width=200 --height=100
|
||||||
|
Loading…
Reference in New Issue
Block a user