You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Checks if a newer version of the script is available
148
154
# Arguments:
@@ -157,35 +163,35 @@ function checkScriptVersion() {
157
163
grep '"tag_name":'|# Get tag line
158
164
sed -E 's/.*"([^"]+)".*/\1/')# Pluck JSON value
159
165
160
-
if [ "$SCRIPT_LATEST_VERSION"!="$SCRIPT_VERSION" ]
161
-
then
166
+
167
+
# local version == latest public release
168
+
if [ $(version $SCRIPT_LATEST_VERSION)-eq$(version "$SCRIPT_VERSION") ];then
169
+
if [ -z"$1" ];then# output only in default mode - if $1 is not set
170
+
dialog \
171
+
--hline "$SCRIPT_GITHUB_URL" \
172
+
--title "Update check: Up-to-date" \
173
+
--backtitle "ydownl.sh" \
174
+
--msgbox "You are running the latest version of $SCRIPT_NAME (as in: $SCRIPT_LATEST_VERSION)" 10 80
175
+
fi
176
+
fi
177
+
178
+
# local version < latest public release -> inform about update
179
+
if [ $(version $SCRIPT_LATEST_VERSION)-gt$(version "$SCRIPT_VERSION") ];then
162
180
dialog \
181
+
--hline "$SCRIPT_GITHUB_URL" \
182
+
--title "Update check: Outdated" \
163
183
--backtitle "ydownl.sh" \
164
-
--msgbox "Your version of $SCRIPT_NAME is outdated.\n\nLatest official version is available under:\n$SCRIPT_LATEST" 10 80
165
-
else
166
-
dialog \
167
-
--backtitle "ydownl.sh" \
168
-
--msgbox "Your version of $SCRIPT_NAME is up to date" 10 80
184
+
--msgbox "You are running the outdated version $SCRIPT_VERSION of $SCRIPT_NAME.\n\nLatest official version is $SCRIPT_LATEST_VERSION and is available under:\n$SCRIPT_LATEST" 10 80
169
185
fi
170
186
171
-
showMainMenu
172
-
}
187
+
# local version > latest public release
188
+
if [ $(version $SCRIPT_LATEST_VERSION)-lt$(version "$SCRIPT_VERSION") ];then
189
+
if [ -z"$1" ];then# output only in default mode - if $1 is not set
190
+
showInfoDialog "Seems like you are running a development version"
191
+
fi
192
+
fi
173
193
174
-
#######################################
175
-
# Displays a text notification using zenity
176
-
# Arguments:
177
-
# notification text
178
-
# Outputs:
179
-
# none
180
-
#######################################
181
-
functionshowGuiNotification() {
182
-
zenity \
183
-
--info \
184
-
--text="$1" \
185
-
--title="$SCRIPT_NAME" \
186
-
--width="$CONFIG_ZENITY_WIDTH" \
187
-
--height="$CONFIG_ZENITY_HEIGHT" \
188
-
--timeout="$CONFIG_ZENITY_TIMEOUT"
194
+
showMainMenu
189
195
}
190
196
191
197
#######################################
@@ -196,6 +202,9 @@ function showGuiNotification() {
0 commit comments