Closed abdheshnayak closed 8 hours ago
This pull request implements a version check and update mechanism for the Kloudlite CLI tool. It adds functionality to notify developers of new CLI versions and enables updates via the 'kl update' command.
sequenceDiagram
participant User
participant CLI as Kloudlite CLI
participant Updater
participant FileClient
User->>CLI: Start CLI
CLI->>FileClient: GetExtraData()
alt Last update check > 12 hours
CLI->>Updater: NewUpdater()
CLI->>Updater: CheckForUpdates()
alt Update available
Updater->>CLI: GetUpdateMessage()
CLI->>User: Notify new version available
CLI->>FileClient: SaveExtraData()
end
end
classDiagram
class Updater {
+CheckForUpdates() bool
+GetUpdateMessage() *string
+Update() error
+GetUpdateUrl() *string
}
class updater {
-releaseInfo map[string]string
+fetchReleaseInfo() map[string]string
}
Updater <|.. updater
updater --> Updater: implements
class FileClient {
+GetExtraData() ExtraData
+SaveExtraData(data ExtraData)
}
class ExtraData {
+string BaseUrl
+string SelectedTeam
+string DnsHostSuffix
+map SelectedEnvs
+time.Time LastUpdateCheck
}
Change | Details | Files |
---|---|---|
Implemented version checking mechanism |
|
clis/kl/root.go pkg/updater/main.go |
Enhanced the update command functionality |
|
clis/kl/update.go |
Updated data structures and constants |
|
domain/fileclient/context.go constants/main.go |
Summary by Sourcery
Add a feature to notify developers of new CLI versions and enable updates via the 'kl update' command. Implement a version check mechanism to alert users when a new version is available and provide instructions for updating.
New Features:
Enhancements: