Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit730b5dd

Browse files
committed
enrich the "not logged in" error message with the full path to the coder
executableSigned-off-by: Callum Styan <callumstyan@gmail.com>
1 parentae3d90b commit730b5dd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎cli/root.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const (
7272
varDisableDirect="disable-direct-connections"
7373
varDisableNetworkTelemetry="disable-network-telemetry"
7474

75-
notLoggedInMessage="You are not logged in. Try logging in using 'coder login <url>'."
75+
notLoggedInMessage="You are not logged in. Try logging in using '%s login <url>'."
7676

7777
envNoVersionCheck="CODER_NO_VERSION_WARNING"
7878
envNoFeatureWarning="CODER_NO_FEATURE_WARNING"
@@ -534,7 +534,11 @@ func (r *RootCmd) InitClient(client *codersdk.Client) serpent.MiddlewareFunc {
534534
rawURL,err:=conf.URL().Read()
535535
// If the configuration files are absent, the user is logged out
536536
ifos.IsNotExist(err) {
537-
returnxerrors.New(notLoggedInMessage)
537+
binPath,err:=os.Executable()
538+
iferr!=nil {
539+
binPath="coder"
540+
}
541+
returnxerrors.Errorf(notLoggedInMessage,binPath)
538542
}
539543
iferr!=nil {
540544
returnerr

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp