Skip to content
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

feat: self update #806

Merged
merged 1 commit into from
Aug 6, 2023
Merged

feat: self update #806

merged 1 commit into from
Aug 6, 2023

Conversation

WaterLemons2k
Copy link
Contributor

@WaterLemons2k WaterLemons2k commented Aug 4, 2023

Usage (added on 2024-06-17)

./ddns-go -u

What does this PR do?

Added packages update and semver that can be used for selfupdate.

Fixes #595.

Motivation

#595

Additional Notes

Most of the code was copied from go-selfupdate, go-update and semver. Most of the unneeded code has been removed, so there is no need to add new dependencies.

In addition, users with the mips arch will not be able to selfupdate, as there is no way to get the float of the MIPS arch.

Tested OS and arch:

  • linux/amd64
  • linux/arm64
  • windows/amd64

Added package `update` and `semver` that can be used for selfupdate.

Most of the code was copied from [go-selfupdate](https://github.com/creativeprojects/go-selfupdate), [go-update](https://github.com/inconshreveable/go-update) and [semver](https://github.com/Masterminds/semver). Most of the unneeded code has been removed, so there is no need to add new dependencies.

In addition, users with the `mips` arch will not be able to selfupdate, as there is no way to get the float of the MIPS arch.

Tested OS and arch:
- [x] linux/amd64
- [x] linux/arm64
- [x] windows/amd64
@jeessy2
Copy link
Owner

jeessy2 commented Aug 4, 2023

👍
网页中考不考虑增加升级版本的功能

@WaterLemons2k
Copy link
Contributor Author

WaterLemons2k commented Aug 4, 2023

👍 网页中考不考虑增加升级版本的功能

由于 Windows 只能在进程退出后才能删除当前文件,所以需要在更新完成后立即退出。

因此目前只考虑单独运行更新程序,不考虑在网页中运行。

Copy link
Owner

@jeessy2 jeessy2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeessy2 jeessy2 merged commit 352e6b8 into jeessy2:master Aug 6, 2023
2 checks passed
@WaterLemons2k WaterLemons2k deleted the update branch August 6, 2023 10:58
@leic4u
Copy link

leic4u commented Nov 16, 2023

请教下这个更新功能怎么使用呢?

@Shengyis
Copy link

请问这个功能如何使用. 谢谢

@jeessy2
Copy link
Owner

jeessy2 commented Jun 17, 2024

终端中运行 ./ddns-go -u

@Shengyis
Copy link

谢谢, 在--help里看到了, 建议写到readme里面

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[功能]:ddns 自动更新
4 participants