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

Commit744693f

Browse files
committed
sanity check lint rules
1 parent5746401 commit744693f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

‎agent/agentssh/agentssh.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030

3131
"cdr.dev/slog"
3232

33-
"github.com/coder/coder/v2/agent/agentexec"
3433
"github.com/coder/coder/v2/agent/usershell"
3534
"github.com/coder/coder/v2/codersdk"
3635
"github.com/coder/coder/v2/pty"
@@ -726,10 +725,11 @@ func (s *Server) CreateCommand(ctx context.Context, script string, env []string)
726725
}
727726
}
728727

729-
cmd,err:=agentexec.PTYCommandContext(ctx,name,args...)
730-
iferr!=nil {
731-
returnnil,xerrors.Errorf("pty command context: %w",err)
732-
}
728+
// cmd, err := agentexec.PTYCommandContext(ctx, name, args...)
729+
// if err != nil {
730+
// return nil, xerrors.Errorf("pty command context: %w", err)
731+
// }
732+
cmd:=pty.CommandContext(ctx,name,args...)
733733
cmd.Dir=s.config.WorkingDirectory()
734734

735735
// If the metadata directory doesn't exist, we run the command

‎agent/reconnectingpty/screen.go‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"io"
1010
"net"
1111
"os"
12+
"os/exec"
1213
"path/filepath"
1314
"strings"
1415
"sync"
@@ -333,21 +334,21 @@ func (rpty *screenReconnectingPTY) sendCommand(ctx context.Context, command stri
333334
run:=func() (bool,error) {
334335
varstdout bytes.Buffer
335336
//nolint:gosec
336-
cmd,err:=agentexec.CommandContext(ctx,"screen",
337+
cmd:=exec.CommandContext(ctx,"screen",
337338
// -x targets an attached session.
338339
"-x",rpty.id,
339340
// -c is the flag for the config file.
340341
"-c",rpty.configFile,
341342
// -X runs a command in the matching session.
342343
"-X",command,
343344
)
344-
iferr!=nil {
345-
returnfalse,xerrors.Errorf("command context: %w",err)
346-
}
345+
//if err != nil {
346+
//return false, xerrors.Errorf("command context: %w", err)
347+
//}
347348
cmd.Env=append(rpty.command.Env,"TERM=xterm-256color")
348349
cmd.Dir=rpty.command.Dir
349350
cmd.Stdout=&stdout
350-
err=cmd.Run()
351+
err:=cmd.Run()
351352
iferr==nil {
352353
returntrue,nil
353354
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp