mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-07 00:12:21 +01:00
add cdpacket
This commit is contained in:
parent
2c62890912
commit
0b172cd689
@ -189,9 +189,22 @@ func doMain() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
errPk := packet.MakeErrorPacket(err.Error())
|
errPk := packet.MakeErrorPacket(err.Error())
|
||||||
sender.SendPacket(errPk)
|
sender.SendPacket(errPk)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if pk.GetType() == packet.CdPacketStr {
|
||||||
|
cdPacket := pk.(*packet.CdPacketType)
|
||||||
|
err := os.Chdir(cdPacket.Dir)
|
||||||
|
resp := packet.MakeResponsePacket(cdPacket.PacketId)
|
||||||
|
if err != nil {
|
||||||
|
resp.Error = err.Error()
|
||||||
|
} else {
|
||||||
|
resp.Success = true
|
||||||
|
}
|
||||||
|
sender.SendPacket(resp)
|
||||||
|
continue
|
||||||
|
}
|
||||||
if pk.GetType() == packet.ErrorPacketStr {
|
if pk.GetType() == packet.ErrorPacketStr {
|
||||||
errPk := pk.(*packet.ErrorPacketType)
|
errPk := pk.(*packet.ErrorPacketType)
|
||||||
errPk.Error = "invalid packet sent to runner: " + errPk.Error
|
errPk.Error = "invalid packet sent to runner: " + errPk.Error
|
||||||
|
Loading…
Reference in New Issue
Block a user