in cmd/cloudshell_open/clone.go [85:105]
func signalRepoCloneStatus(success bool) error {
c, err := net.Dial("tcp", net.JoinHostPort("localhost", "8998"))
if err != nil {
return fmt.Errorf("failed to connect to cloudshell host: %w", err)
}
msgFmt := `[null,null,null,[null,null,null,null,[%d]]]`
var msg string
if success {
msg = fmt.Sprintf(msgFmt, 1)
} else {
msg = fmt.Sprintf(msgFmt, 0)
}
msg = fmt.Sprintf("%d\n%s", len(msg), msg)
if _, err := c.Write([]byte(msg)); err != nil {
return fmt.Errorf("failed to send data to cloudshell host: %w", nil)
}
if err := c.Close(); err != nil {
return fmt.Errorf("failed to close conn to cloudshell host: %w", nil)
}
return nil
}