Skip to content

Commit ea64a60

Browse files
authored
[bug fix] do not check version for devbox log, and for commands whose prefix is in the skip-list (#1424)
## Summary In the generated shellrc file, we invoke `devbox log` to track shell start times. ``` > git grep "devbox log" internal/impl/shellrc.tmpl:devbox log shell-ready {{ .ShellStartTime }} internal/impl/shellrc.tmpl:devbox log shell-interactive {{ .ShellStartTime }} internal/impl/shellrc_fish.tmpl:devbox log shell-ready {{ .ShellStartTime }} internal/impl/shellrc_fish.tmpl:devbox log shell-interactive {{ .ShellStartTime }} ``` We should skip checking if devbox version is up-to-date for this case. Also, made a change to check if the commandPath matches the prefix of the commandSkipList items. This will #1420 ## How was it tested? Did not test. It compiles.
1 parent 4259d40 commit ea64a60

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/vercheck/vercheck.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ var commandSkipList = []string{
4848
"devbox global shellenv",
4949
"devbox shellenv",
5050
"devbox version update",
51+
"devbox log",
5152
}
5253

5354
// CheckVersion checks the launcher and binary versions and prints a notice if
@@ -68,7 +69,11 @@ func CheckVersion(w io.Writer, commandPath string) {
6869
return
6970
}
7071

71-
if lo.Contains(commandSkipList, commandPath) {
72+
hasSkipPrefix := lo.ContainsBy(
73+
commandSkipList,
74+
func(skipPath string) bool { return strings.HasPrefix(commandPath, skipPath) },
75+
)
76+
if hasSkipPrefix {
7277
return
7378
}
7479

0 commit comments

Comments
 (0)