Skip to content

Commit 744693f

Browse files
committed
sanity check lint rules
1 parent 5746401 commit 744693f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

agent/agentssh/agentssh.go

+5-5
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-
if err != nil {
731-
return nil, 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

+6-5
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
var stdout 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-
if err != nil {
345-
return false, 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
if err == nil {
352353
return true, nil
353354
}

0 commit comments

Comments
 (0)