mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2026-03-14 03:41:27 +01:00
feat: add --no-update-check flag and disable update check via config (issue #23)
Add support for disabling the automatic update check at startup, which could cause delays on air-gapped or offline machines due to DNS timeouts. - Add --no-update-check CLI flag for one-time override - Add check_for_updates field (*bool) to AppConfig with default true - CLI flag overrides the config file setting (both feed into IsUpdateCheckEnabled) - Move update check from --version template to TUI Init() only, respecting the new configuration - Remove getVersionWithUpdateCheck() from cmd/root.go; --version now prints a plain version string - Rename internal/config/keybindings.go → appconfig.go and keybindings_test.go → appconfig_test.go to reflect the broader scope of the file - Add TestIsUpdateCheckEnabled with table-driven cases (nil config, nil field, true, false) and extend existing integration test with a CheckForUpdates round-trip - Update README: document --no-update-check flag, config option, and rename "Custom Key Bindings" section to "Application Configuration"
This commit is contained in:
@@ -74,8 +74,8 @@ func (m Model) Init() tea.Cmd {
|
||||
// Basic initialization commands
|
||||
cmds = append(cmds, textinput.Blink)
|
||||
|
||||
// Check for version updates if we have a current version
|
||||
if m.currentVersion != "" {
|
||||
// Check for version updates if we have a current version and updates are enabled
|
||||
if m.currentVersion != "" && m.appConfig.IsUpdateCheckEnabled() {
|
||||
cmds = append(cmds, checkVersionCmd(m.currentVersion))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user