MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / UpdateWsh

Method UpdateWsh

pkg/remote/conncontroller/conncontroller.go:603–617  ·  view source on GitHub ↗
(ctx context.Context, clientDisplayName string, remoteInfo *wshrpc.RemoteInfo)

Source from the content-addressed store, hash-verified

601`)
602
603func (conn *SSHConn) UpdateWsh(ctx context.Context, clientDisplayName string, remoteInfo *wshrpc.RemoteInfo) error {
604 conn.Infof(ctx, "attempting to update wsh for connection %s (os:%s arch:%s version:%s)\n",
605 conn.GetName(), remoteInfo.ClientOs, remoteInfo.ClientArch, remoteInfo.ClientVersion)
606 client := conn.GetClient()
607 if client == nil {
608 return fmt.Errorf("cannot update wsh: ssh client is not connected")
609 }
610 err := remote.CpWshToRemote(ctx, client, remoteInfo.ClientOs, remoteInfo.ClientArch)
611 if err != nil {
612 return fmt.Errorf("error installing wsh to remote: %w", err)
613 }
614 conn.Infof(ctx, "successfully updated wsh on %s\n", conn.GetName())
615 return nil
616
617}
618
619// returns (allowed, error)
620func (conn *SSHConn) getPermissionToInstallWsh(ctx context.Context, clientDisplayName string) (bool, error) {

Callers

nothing calls this directly

Calls 4

InfofMethod · 0.95
GetNameMethod · 0.95
GetClientMethod · 0.95
CpWshToRemoteFunction · 0.92

Tested by

no test coverage detected