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
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commitc2eda4a

Browse files
authored
Merge pull request#45 from cdr/fix-exitcode
Fix exit code
2 parents6ffd5de +61727c6 commitc2eda4a

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

‎cmd/coder/shell.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ func sendResizeEvents(ctx context.Context, termfd int, process wsep.Process) {
6363

6464
err=process.Resize(ctx,uint16(height),uint16(width))
6565
iferr!=nil {
66-
flog.Error("set term size: %v",err)
6766
return
6867
}
6968

@@ -99,7 +98,7 @@ func (cmd *shellCmd) Run(fl *pflag.FlagSet) {
9998
os.Exit(exitErr.Code)
10099
}
101100
iferr!=nil {
102-
flog.Fatal("run command: %v. Is %q online?",err,envName)
101+
flog.Fatal("run command: %v",err)
103102
}
104103
}
105104

@@ -133,6 +132,7 @@ func runCommand(ctx context.Context, envName string, command string, args []stri
133132
Command:command,
134133
Args:args,
135134
TTY:tty,
135+
Stdin:true,
136136
})
137137
iferr!=nil {
138138
returnerr
@@ -163,8 +163,8 @@ func runCommand(ctx context.Context, envName string, command string, args []stri
163163
}
164164
}()
165165
err=process.Wait()
166-
ifxerrors.Is(err,ctx.Err()) {
167-
returnxerrors.Errorf("network error")
166+
iferr!=nil&&xerrors.Is(err,ctx.Err()) {
167+
returnxerrors.Errorf("network error, is %q online?",envName)
168168
}
169169
returnerr
170170
}

‎go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module cdr.dev/coder-cli
33
go1.14
44

55
require (
6-
cdr.dev/wsepv0.0.0-20200612224539-e66f8bb64883
6+
cdr.dev/wsepv0.0.0-20200615020153-e2b1c576fc40
77
github.com/fatih/colorv1.9.0// indirect
88
github.com/gorilla/websocketv1.4.1
99
github.com/kirsle/configdirv0.0.0-20170128060238-e45d2f54772f

‎go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ cdr.dev/wsep v0.0.0-20200602025116-5cbe721683df h1:9KgAywWKNQMYi3gvu4HyExiuXJhoN
44
cdr.dev/wsepv0.0.0-20200602025116-5cbe721683df/go.mod h1:2VKClUml3gfmLez0gBxTJIjSKszpQotc2ZqPdApfK/Y=
55
cdr.dev/wsepv0.0.0-20200612224539-e66f8bb64883 h1:nr/trZU6911y9PohrsVaujzJPrtN7bUSX7yfvenYbc0=
66
cdr.dev/wsepv0.0.0-20200612224539-e66f8bb64883/go.mod h1:2VKClUml3gfmLez0gBxTJIjSKszpQotc2ZqPdApfK/Y=
7+
cdr.dev/wsepv0.0.0-20200613153816-ed81c4ad638b h1:cd2Fx+EBMWxWFMdODG/OWRhF9X8OWQ5DnsCEeCfd0Y4=
8+
cdr.dev/wsepv0.0.0-20200613153816-ed81c4ad638b/go.mod h1:2VKClUml3gfmLez0gBxTJIjSKszpQotc2ZqPdApfK/Y=
9+
cdr.dev/wsepv0.0.0-20200613225213-3384735ae5e5 h1:x6UJpHOO7mz//OrAdysmQIW+jdXAQ+n35eol5s+O6WU=
10+
cdr.dev/wsepv0.0.0-20200613225213-3384735ae5e5/go.mod h1:2VKClUml3gfmLez0gBxTJIjSKszpQotc2ZqPdApfK/Y=
11+
cdr.dev/wsepv0.0.0-20200613231142-71da214c188e h1:ZOQoyb0N07vc9MMet/IQFCpKSObcZZt9o+nPFz7/zNM=
12+
cdr.dev/wsepv0.0.0-20200613231142-71da214c188e/go.mod h1:2VKClUml3gfmLez0gBxTJIjSKszpQotc2ZqPdApfK/Y=
13+
cdr.dev/wsepv0.0.0-20200615020153-e2b1c576fc40 h1:f369880iSAZ3cXwvbdc9WIyy3FZ4yanusYZjaVHeis4=
14+
cdr.dev/wsepv0.0.0-20200615020153-e2b1c576fc40/go.mod h1:2VKClUml3gfmLez0gBxTJIjSKszpQotc2ZqPdApfK/Y=
715
cloud.google.com/gov0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
816
cloud.google.com/gov0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
917
cloud.google.com/gov0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp