MCPcopy
hub / github.com/wavetermdev/waveterm / ConnReinstallWshCommand

Method ConnReinstallWshCommand

pkg/wshrpc/wshserver/wshserver.go:657–681  ·  view source on GitHub ↗
(ctx context.Context, data wshrpc.ConnExtData)

Source from the content-addressed store, hash-verified

655}
656
657func (ws *WshServer) ConnReinstallWshCommand(ctx context.Context, data wshrpc.ConnExtData) error {
658 if conncontroller.IsLocalConnName(data.ConnName) {
659 return nil
660 }
661 ctx = genconn.ContextWithConnData(ctx, data.LogBlockId)
662 ctx = termCtxWithLogBlockId(ctx, data.LogBlockId)
663 connName := data.ConnName
664 if strings.HasPrefix(connName, "wsl://") {
665 distroName := strings.TrimPrefix(connName, "wsl://")
666 conn := wslconn.GetWslConn(distroName)
667 if conn == nil {
668 return fmt.Errorf("connection not found: %s", connName)
669 }
670 return conn.InstallWsh(ctx, "")
671 }
672 connOpts, err := remote.ParseOpts(connName)
673 if err != nil {
674 return fmt.Errorf("error parsing connection name: %w", err)
675 }
676 conn := conncontroller.GetConn(connOpts)
677 if conn == nil {
678 return fmt.Errorf("connection not found: %s", connName)
679 }
680 return conn.InstallWsh(ctx, "")
681}
682
683func (ws *WshServer) ConnUpdateWshCommand(ctx context.Context, remoteInfo wshrpc.RemoteInfo) (bool, error) {
684 handler := wshutil.GetRpcResponseHandlerFromContext(ctx)

Callers

nothing calls this directly

Calls 7

IsLocalConnNameFunction · 0.92
ContextWithConnDataFunction · 0.92
GetWslConnFunction · 0.92
ParseOptsFunction · 0.92
GetConnFunction · 0.92
termCtxWithLogBlockIdFunction · 0.85
InstallWshMethod · 0.45

Tested by

no test coverage detected