diff --git a/src/GitS-Core.package/GSBrowser.class/instance/actionSelfUpdate.st b/src/GitS-Core.package/GSBrowser.class/instance/actionSelfUpdate.st index cc293de0..76961d9c 100644 --- a/src/GitS-Core.package/GSBrowser.class/instance/actionSelfUpdate.st +++ b/src/GitS-Core.package/GSBrowser.class/instance/actionSelfUpdate.st @@ -1,3 +1,3 @@ actions actionSelfUpdate - GSSelfUpdater selfUpdate. \ No newline at end of file + GSSelfUpdater actionSelfUpdate. \ No newline at end of file diff --git a/src/GitS-Core.package/GSBrowser.class/methodProperties.json b/src/GitS-Core.package/GSBrowser.class/methodProperties.json index f2a1f6b9..794c7e6a 100644 --- a/src/GitS-Core.package/GSBrowser.class/methodProperties.json +++ b/src/GitS-Core.package/GSBrowser.class/methodProperties.json @@ -16,7 +16,7 @@ "actionPull" : "mad 12/1/2024 21:45", "actionPush" : "mad 12/1/2024 21:45", "actionRefresh" : "mad 12/23/2024 20:01", - "actionSelfUpdate" : "mad 10/9/2024 16:47", + "actionSelfUpdate" : "mad 12/23/2024 21:06", "actionSetSelfUpdateBranch" : "mad 11/4/2024 13:13", "activeCommit" : "mad 9/14/2023 15:24", "activeCommit:" : "mad 5/15/2024 21:42", diff --git a/src/GitS-Core.package/GSSelfUpdater.class/class/actionSelfUpdate.st b/src/GitS-Core.package/GSSelfUpdater.class/class/actionSelfUpdate.st new file mode 100644 index 00000000..bcd8cff2 --- /dev/null +++ b/src/GitS-Core.package/GSSelfUpdater.class/class/actionSelfUpdate.st @@ -0,0 +1,6 @@ +self-updating +actionSelfUpdate + (self isNewVersionAvailableIfError: [true]) ifFalse: [ + (self confirm: 'No new version seems to be available. Do you want to update anyway?') + ifFalse: [^ self]]. + self selfUpdate. \ No newline at end of file diff --git a/src/GitS-Core.package/GSSelfUpdater.class/class/basicCheckForNewVersion.st b/src/GitS-Core.package/GSSelfUpdater.class/class/basicCheckForNewVersion.st index 184f6cdf..a2eeb73b 100644 --- a/src/GitS-Core.package/GSSelfUpdater.class/class/basicCheckForNewVersion.st +++ b/src/GitS-Core.package/GSSelfUpdater.class/class/basicCheckForNewVersion.st @@ -1,4 +1,4 @@ check basicCheckForNewVersion - self isNewVersionAvailable ifTrue: [self promptForNewVersion]. + (self isNewVersionAvailableIfError: [^ self]) ifTrue: [self promptForNewVersion]. self lastVersionCheck: DateAndTime now. \ No newline at end of file diff --git a/src/GitS-Core.package/GSSelfUpdater.class/class/changeLog.st b/src/GitS-Core.package/GSSelfUpdater.class/class/changeLog.st index 311c23b2..9b135db5 100644 --- a/src/GitS-Core.package/GSSelfUpdater.class/class/changeLog.st +++ b/src/GitS-Core.package/GSSelfUpdater.class/class/changeLog.st @@ -4,4 +4,5 @@ changeLog 'Warnings about uncommitted changes before merging only occur when not up-to-date.'. 'The list of branches, remote branches, etc. is now a tree. Hover over the root nodes to get an explanation.'. 'A change log is shown after a self-update (the one you are currently seeing :)).'. + 'Before a manual self-update is done, git-s checks whether a new version exists and prompts the user to cancel if not.'. } \ No newline at end of file diff --git a/src/GitS-Core.package/GSSelfUpdater.class/class/isNewVersionAvailable.st b/src/GitS-Core.package/GSSelfUpdater.class/class/isNewVersionAvailable.st deleted file mode 100644 index 50d02f97..00000000 --- a/src/GitS-Core.package/GSSelfUpdater.class/class/isNewVersionAvailable.st +++ /dev/null @@ -1,3 +0,0 @@ -check -isNewVersionAvailable - ^ ([self getShaOfVersion: self branchName] ifError: [^ false]) ~= self installedVersion \ No newline at end of file diff --git a/src/GitS-Core.package/GSSelfUpdater.class/class/isNewVersionAvailableIfError..st b/src/GitS-Core.package/GSSelfUpdater.class/class/isNewVersionAvailableIfError..st new file mode 100644 index 00000000..78557069 --- /dev/null +++ b/src/GitS-Core.package/GSSelfUpdater.class/class/isNewVersionAvailableIfError..st @@ -0,0 +1,3 @@ +check +isNewVersionAvailableIfError: aBlock + ^ ([self getShaOfVersion: self branchName] ifError: [^ aBlock value]) ~= self installedVersion \ No newline at end of file diff --git a/src/GitS-Core.package/GSSelfUpdater.class/methodProperties.json b/src/GitS-Core.package/GSSelfUpdater.class/methodProperties.json index 964d73b9..dbec1229 100644 --- a/src/GitS-Core.package/GSSelfUpdater.class/methodProperties.json +++ b/src/GitS-Core.package/GSSelfUpdater.class/methodProperties.json @@ -1,9 +1,10 @@ { "class" : { - "basicCheckForNewVersion" : "mad 10/25/2024 11:34", + "actionSelfUpdate" : "mad 12/23/2024 21:06", + "basicCheckForNewVersion" : "mad 12/23/2024 21:01", "branchName" : "mad 11/4/2024 13:01", "branchName:" : "mad 11/4/2024 13:02", - "changeLog" : "mad 12/23/2024 21:12", + "changeLog" : "mad 12/23/2024 21:15", "checkForNewVersion" : "mad 10/25/2024 11:32", "fullRepositoryName" : "mad 10/9/2024 16:33", "getShaOfVersion:" : "mad 10/24/2024 15:07", @@ -12,7 +13,7 @@ "installScriptForVersion:" : "mad 10/9/2024 16:50", "installedVersion" : "mad 10/9/2024 16:40", "installedVersion:" : "mad 10/9/2024 16:40", - "isNewVersionAvailable" : "mad 10/25/2024 11:22", + "isNewVersionAvailableIfError:" : "mad 12/23/2024 21:01", "lastVersionCheck" : "mad 10/25/2024 11:33", "lastVersionCheck:" : "mad 10/25/2024 11:34", "lastVersionCheckWasRecent" : "mad 10/25/2024 11:35",