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

Function connReinstallRun

cmd/wsh/cmd/wshcmd-conn.go:125–146  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

123}
124
125func connReinstallRun(cmd *cobra.Command, args []string) error {
126 if len(args) != 1 {
127 if RpcContext.Conn == "" {
128 return fmt.Errorf("no connection specified")
129 }
130 args = []string{RpcContext.Conn}
131 }
132 connName := args[0]
133 if err := validateConnectionName(connName); err != nil {
134 return err
135 }
136 data := wshrpc.ConnExtData{
137 ConnName: connName,
138 LogBlockId: RpcContext.BlockId,
139 }
140 err := wshclient.ConnReinstallWshCommand(RpcClient, data, &wshrpc.RpcOpts{Timeout: 60000})
141 if err != nil {
142 return fmt.Errorf("reinstalling connection: %w", err)
143 }
144 WriteStdout("wsh reinstalled on connection %q\n", connName)
145 return nil
146}
147
148func connDisconnectRun(cmd *cobra.Command, args []string) error {
149 connName := args[0]

Callers

nothing calls this directly

Calls 3

ConnReinstallWshCommandFunction · 0.92
validateConnectionNameFunction · 0.85
WriteStdoutFunction · 0.85

Tested by

no test coverage detected