-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Obtaining the contents of the zip folder #16
Comments
Edit: |
Hello, Thank you for your interest in this project. Yes this is totally possible! :) The provider you are passing to the updater has the following methods:
You can call the provider by yourself if the update is successful. If you need examples of how to use the provider you can look at the unit tests:
I should probably add something to run post-update actions so you don't have to call Open() and Close() yourself (which can take some time depending on the provider you are using), it wouldn't be too hard. go-rocket-update/pkg/updater/updater.go Line 142 in 77dfb83
Fell free to make a PR if you want :) I can try to find some time over the weekend to do that if you are interested in that feature but I might not be able to find the time. And to answer: "how to copy info.Path to a relative dir?" just call provider.Retrieve(info.Path, YOUR_DESTINATION_PATH) :) |
Hi @mouuff A couple of questions:
Really appriciate your time, I think it's a great project. I just feel that a bit more documentation would help this project so much! Have a good one! |
Hello!
EDIT: |
Hey @mouuff Thanks for all of these details and great info. With regards to the call back for updating files, if you give me some more details of what you think may work I can help with a PR. Although it's great functionality, I won't need to sign packages, but I would love to verify the checksum of the file. We could perhaps add a // getRemoteSum retrieves the checksums file from Git and
// separates the release versions (os) by scanning
// each line. The archive name is compared to
// find a match.
func getRemoteSum(url, path string) (string, error) {
resp, err := http.Get(url)
if err != nil {
return "", err
}
defer resp.Body.Close()
scanner := bufio.NewScanner(resp.Body)
for scanner.Scan() {
line := strings.Split(scanner.Text(), Separator)
if len(line) != 2 { //nolint:gomnd
continue
}
if line[1] == filepath.Base(path) {
return line[0], nil
}
}
return "", ErrNoCheckSum
} Then it would just be a case of checking if it's set when it's stored in the Sorry if this post has gone on a bit of a tangent! Many thanks. |
Hello, Something like:
And in the
Then you can pass your implementation to the updater :) As for the checksum, if we handle that, I would prefer to make it work for all providers. We can dedicate a relative path for the checksum (pretty much like the For example And the It would work the name way as for the Then for the Github case, we have many solutions:
|
Hello, I found some time to add this "hook" feature. Here is an example:
You must also pass this struct as Regards |
Thanks for the update 😀 |
Hi,
Thanks for the great package, I have been looking for this for a while.
Is it possible to retrieve the contents of the zip folder? I have multiple fies and folders to update and want to manually override them along with the update.
Is this possible?
Many thanks.
The text was updated successfully, but these errors were encountered: