mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 19:28:16 +00:00
remove cli update notification delay
This commit is contained in:
@@ -28,9 +28,9 @@ func CheckForUpdate() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
daysSinceRelease, _ := daysSinceDate(publishedDate)
|
// daysSinceRelease, _ := daysSinceDate(publishedDate)
|
||||||
|
|
||||||
if latestVersion != CLI_VERSION && daysSinceRelease > 2 {
|
if latestVersion != CLI_VERSION {
|
||||||
yellow := color.New(color.FgYellow).SprintFunc()
|
yellow := color.New(color.FgYellow).SprintFunc()
|
||||||
blue := color.New(color.FgCyan).SprintFunc()
|
blue := color.New(color.FgCyan).SprintFunc()
|
||||||
black := color.New(color.FgBlack).SprintFunc()
|
black := color.New(color.FgBlack).SprintFunc()
|
||||||
@@ -151,15 +151,15 @@ func IsRunningInDocker() bool {
|
|||||||
return strings.Contains(string(cgroup), "docker")
|
return strings.Contains(string(cgroup), "docker")
|
||||||
}
|
}
|
||||||
|
|
||||||
func daysSinceDate(dateString string) (int, error) {
|
// func daysSinceDate(dateString string) (int, error) {
|
||||||
layout := "2006-01-02T15:04:05Z"
|
// layout := "2006-01-02T15:04:05Z"
|
||||||
parsedDate, err := time.Parse(layout, dateString)
|
// parsedDate, err := time.Parse(layout, dateString)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
return 0, err
|
// return 0, err
|
||||||
}
|
// }
|
||||||
|
|
||||||
currentTime := time.Now()
|
// currentTime := time.Now()
|
||||||
difference := currentTime.Sub(parsedDate)
|
// difference := currentTime.Sub(parsedDate)
|
||||||
days := int(difference.Hours() / 24)
|
// days := int(difference.Hours() / 24)
|
||||||
return days, nil
|
// return days, nil
|
||||||
}
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user