Skip to content
Prev Previous commit
Next Next commit
use unix ts for filename
  • Loading branch information
johnstcn committed Mar 1, 2024
commit f42a1dd83a6b7c733cdd5bb9a52df136a20f1f43
10 changes: 2 additions & 8 deletions cli/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"cdr.dev/slog"
"cdr.dev/slog/sloggers/sloghuman"
"github.com/coder/coder/v2/cli/clibase"
"github.com/coder/coder/v2/coderd/util/tz"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/support"
)
Expand Down Expand Up @@ -74,12 +73,7 @@ func (r *RootCmd) support() *clibase.Cmd {
if err != nil {
return xerrors.Errorf("could not determine current working directory: %w", err)
}
loc, err := tz.TimezoneIANA()
if err != nil {
loc = time.UTC
}
tsStr := time.Now().In(loc).Format("2006-01-02-150405")
fname := "coder-support-" + tsStr + ".zip"
fname := fmt.Sprintf("coder-support-%d.zip", time.Now().Unix())
outputPath = filepath.Join(cwd, fname)
}

Expand All @@ -101,7 +95,7 @@ func (r *RootCmd) support() *clibase.Cmd {
Flag: "output",
FlagShorthand: "o",
Env: "CODER_SUPPORT_BUNDLE_OUTPUT",
Description: "Path to which to output the generated support bundle. Defaults to coder-support-YYYYmmdd-HHMMSS.zip.",
Description: "File path for writing the generated support bundle. Defaults to coder-support-$(date +%s).zip.",
Value: clibase.StringOf(&outputPath),
},
}
Expand Down