MCPcopy
hub / github.com/jesseduffield/lazygit / skipUpdateCheck

Method skipUpdateCheck

pkg/updates/updates.go:153–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151}
152
153func (u *Updater) skipUpdateCheck() bool {
154 // will remove the check for windows after adding a manifest file asking for
155 // the required permissions
156 if runtime.GOOS == "windows" {
157 u.Log.Info("Updating is currently not supported for windows until we can fix permission issues")
158 return true
159 }
160
161 if u.Config.GetVersion() == "unversioned" {
162 u.Log.Info("Current version is not built from an official release so we won't check for an update")
163 return true
164 }
165
166 if u.Config.GetBuildSource() != "buildBinary" {
167 u.Log.Info("Binary is not built with the buildBinary flag so we won't check for an update")
168 return true
169 }
170
171 userConfig := u.UserConfig()
172 if userConfig.Update.Method == "never" {
173 u.Log.Info("Update method is set to never so we won't check for an update")
174 return true
175 }
176
177 currentTimestamp := time.Now().Unix()
178 lastUpdateCheck := u.Config.GetAppState().LastUpdateCheck
179 days := userConfig.Update.Days
180
181 if (currentTimestamp-lastUpdateCheck)/(60*60*24) < days {
182 u.Log.Info("Last update was too recent so we won't check for an update")
183 return true
184 }
185
186 return false
187}
188
189func (u *Updater) mappedOs(os string) string {
190 osMap := map[string]string{

Callers 1

CheckForNewUpdateMethod · 0.95

Calls 4

UserConfigMethod · 0.80
GetVersionMethod · 0.65
GetBuildSourceMethod · 0.65
GetAppStateMethod · 0.65

Tested by

no test coverage detected