Skip to content

Commit 64212d6

Browse files
committed
only do some cleanup if nvim successfully connected
1 parent a5e674d commit 64212d6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/client/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,11 @@ var CliClientOpenCommand = cli.Command{
195195
killAllCmds(nvrhContext.CommandsToKill)
196196
os.Remove(nvrhContext.LocalSocketPath)
197197
if nvrhContext.SshClient != nil {
198-
nvrhContext.SshClient.Run(fmt.Sprintf("rm -f '%s'", nvrhContext.RemoteSocketPath), nil)
199-
nvrhContext.SshClient.Run(fmt.Sprintf("rm -f '%s'", nvrhContext.BrowserScriptPath), nil)
198+
if nv != nil {
199+
nvrhContext.SshClient.Run(fmt.Sprintf("rm -f '%s'", nvrhContext.RemoteSocketPath), nil)
200+
nvrhContext.SshClient.Run(fmt.Sprintf("rm -f '%s'", nvrhContext.BrowserScriptPath), nil)
201+
}
202+
200203
nvrhContext.SshClient.Close()
201204
}
202205
}()

0 commit comments

Comments
 (0)