Skip to content

Commit

Permalink
Startup won't hang even if a new version is available.
Browse files Browse the repository at this point in the history
The same kind of dialog is displayed when a new version is available
and it should have similar increased timeout guard.
  • Loading branch information
stisti committed Jul 7, 2012
1 parent 23e32ab commit d4322e2
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions main.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,21 @@ on run

-- Version check might fail, so guard against it.
try
if this_is_latest_version() then
logger("Update check: This Jenkins.app is the latest version")
else
logger("Update check: There is a newer Jenkins.app available")
display dialog "A newer version of Jenkins.app is available. Would you like to update?" & return & "(Automatic startup in 15 seconds.)" with title "Jenkins" with icon path_to_icon buttons {"Maybe later", "Update now"} default button "Update now" giving up after 15
if button returned of the result is equal to "Update now" then
open location "https://github.com/stisti/jenkins-app/downloads"
quit
(* To force quit to happen without continuing to the end of the handler, use the return statement to immediately return from handler. *)
return
activate
with timeout of 300 seconds
if this_is_latest_version() then
logger("Update check: This Jenkins.app is the latest version")
else
logger("Update check: There is a newer Jenkins.app available")
display dialog "A newer version of Jenkins.app is available. Would you like to update?" & return & "(Automatic startup in 15 seconds.)" with title "Jenkins" with icon path_to_icon buttons {"Maybe later", "Update now"} default button "Update now" giving up after 15
if button returned of the result is equal to "Update now" then
open location "https://github.com/stisti/jenkins-app/downloads"
quit
(* To force quit to happen without continuing to the end of the handler, use the return statement to immediately return from handler. *)
return
end if
end if
end if
end timeout
end try

tell application "Finder"
Expand Down

0 comments on commit d4322e2

Please sign in to comment.