Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 3cffbca

Browse files
committed
Use access URI
1 parent c9e5d1d commit 3cffbca

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

internal/cmd/envs.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"os"
1212

1313
"cdr.dev/coder-cli/coder-sdk"
14+
"cdr.dev/coder-cli/internal/config"
1415
"cdr.dev/coder-cli/internal/x/xcobra"
1516
"cdr.dev/coder-cli/pkg/clog"
1617
"cdr.dev/coder-cli/pkg/tablewriter"
@@ -628,5 +629,15 @@ func buildUpdateReq(ctx context.Context, client *coder.Client, conf updateConf)
628629
}
629630

630631
func autoStartInfo() {
631-
clog.LogInfo("⚡NEW: Automate daily environment startup", "Visit /preferences to configure your preferred time")
632+
var preferencesURI string
633+
634+
accessURI, err := config.URL.Read()
635+
if err != nil {
636+
// Error is fairly benign in this case, fallback to relative URI
637+
preferencesURI = "/preferences"
638+
} else {
639+
preferencesURI = fmt.Sprintf("%s%s", accessURI, "/preferences?tab=autostart")
640+
}
641+
642+
clog.LogInfo("⚡NEW: Automate daily environment startup", "Visit "+preferencesURI+" to configure your preferred time")
632643
}

0 commit comments

Comments
 (0)