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: removed -latest flag and instead support latest version marker, refactor #233

Merged
merged 6 commits into from
Jan 7, 2025

Conversation

filipowm
Copy link
Contributor

@filipowm filipowm commented Jan 2, 2025

Hey,

I'm dropping next one with few minor changes, mostly around making code generator a bit easier to read through and understand, but also simplify it. It was mostly around moving code away from main.go, which now is cleaner and acting only as CLI entrypoint, to dedicated files.

  1. Removed -latest flag and instead you can specify latest (being a default when no specific version provided) as a version.
    From:
go:generate go run ../fields/ -version-base-dir=../fields/ -latest
go:generate go run ../fields/ -version-base-dir=../fields/ 8.6.9

To:

go:generate go run ../fields/ -version-base-dir=../fields/
go:generate go run ../fields/ -version-base-dir=../fields/ latest # equivalent of above
go:generate go run ../fields/ -version-base-dir=../fields/ 8.6.9
  1. Moved code responsible for determing unifi version and download URL to version.go, together with writing version file
  2. Moved code downloading deb and extracting from it files to download.go (renamed from extract.go
  3. Moved all code generation to generator.go

I tested changes additionally manually on few versions of controller and everything works as before.

@joshuaspence joshuaspence merged commit 3fda373 into paultyng:main Jan 7, 2025
5 checks passed
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.

2 participants