go-selfupdate icon indicating copy to clipboard operation
go-selfupdate copied to clipboard

Now Know When App Successfully Updates + Added Testing + Refactoring

Open EliCDavis opened this issue 4 years ago • 6 comments

This diverges from what the current process looks like for using this library.

I got rid of certain things like the random update checking times and tried to make it simpler to set up.

This isn't complete, but I wanted to know if you would be interested in all these changes, or if you'd prefer to keep going with your current method for updating.

If you are interested, I'll clean up the rest of the documentation to match the new way.

EliCDavis avatar Jan 07 '20 15:01 EliCDavis

@EliCDavis absolutely useful to me as I was looking for a way to trigger the update myself, instead of waiting on a timer. I still would like a way to be able to deactivate the patch thing, which is throwing errors while, it's expected (that there is no patch). And ideally a way to customize file names instead of simply darwin-amd64.gz. This doesn't tell much anything to non-tech people (as I use this place also for public download).

0cv avatar Mar 06 '20 13:03 0cv

Hi @Krisa, When you say "I still would like a way to be able to deactivate the patch thing, which is throwing errors while, it's expected (that there is no patch)." Are you referring to this repository or mine? I don't think mine throws any errors if there is no update to be made. https://github.com/EliCDavis/go-selfupdate/blob/master/selfupdate/selfupdate.go#L151

As for file names, you have a good point.

EliCDavis avatar Mar 06 '20 14:03 EliCDavis

@EliCDavis I was referring to yours (albeit this original rep is the same too). It goes no matter what into the function getExeWithPatchForVersion https://github.com/EliCDavis/go-selfupdate/blob/master/selfupdate/selfupdate.go#L180 and it fails when it makes the query.

0cv avatar Mar 06 '20 14:03 0cv

I guess I'm confused about why it gets there. It's already had to do a fetch to determine if an update is available. If it got to that point that means there is one. I guess I'm missing something

EliCDavis avatar Mar 06 '20 14:03 EliCDavis

Not so sure, but it looks to me expected. Then it goes to this line https://github.com/EliCDavis/go-selfupdate/blob/master/selfupdate/selfupdate.go#L192 as an error is returned and successfully update the lib. But hitting the patch URL in the first instance is the problem.

0cv avatar Mar 06 '20 14:03 0cv

As for the file names, it could be an optional mapping when the function is initialised which tells which file correspond to which platform. For example

updater.SetPlatforms(&Platform{
	DarwinAmd64: "myosx",
	LinuxArm:          "linuxapp",
	Windows386:  "windowsApp.exe",
})

0cv avatar Mar 06 '20 14:03 0cv

binaries and exes pushed to branch

sanbornm avatar Jul 09 '23 17:07 sanbornm