@@ -281,12 +281,16 @@ func makeSSHConfigEntryV2(workspace entity.Workspace, privateKeyPath string, clo
281281 privateKeyPath = "\" " + privateKeyPath + "\" "
282282 if workspace .IsLegacy () {
283283 proxyCommand := makeProxyCommand (workspace .ID )
284+ projPath , err := workspace .GetProjectFolderPath ()
285+ if err != nil {
286+ return "" , breverrors .WrapAndTrace (err )
287+ }
284288 entry := SSHConfigEntryV2 {
285289 Alias : alias ,
286290 IdentityFile : privateKeyPath ,
287291 User : "brev" ,
288292 ProxyCommand : proxyCommand ,
289- Dir : workspace . GetProjectFolderPath () ,
293+ Dir : projPath ,
290294 }
291295 tmpl , err := template .New (alias ).Parse (SSHConfigEntryTemplateV2 )
292296 if err != nil {
@@ -304,11 +308,15 @@ func makeSSHConfigEntryV2(workspace entity.Workspace, privateKeyPath string, clo
304308 hostname := workspace .GetHostname ()
305309 if workspace .SSHProxyHostname == "" {
306310 port := workspace .GetSSHPort ()
311+ projPath , err := workspace .GetProjectFolderPath ()
312+ if err != nil {
313+ return "" , breverrors .WrapAndTrace (err )
314+ }
307315 entry := SSHConfigEntryV2 {
308316 Alias : alias ,
309317 IdentityFile : privateKeyPath ,
310318 User : user ,
311- Dir : workspace . GetProjectFolderPath () ,
319+ Dir : projPath ,
312320 HostName : hostname ,
313321 Port : port ,
314322 }
@@ -322,12 +330,16 @@ func makeSSHConfigEntryV2(workspace entity.Workspace, privateKeyPath string, clo
322330 }
323331 } else {
324332 proxyCommand := makeCloudflareSSHProxyCommand (cloudflaredBinaryPath , workspace .SSHProxyHostname )
333+ projPath , err := workspace .GetProjectFolderPath ()
334+ if err != nil {
335+ return "" , breverrors .WrapAndTrace (err )
336+ }
325337 entry := SSHConfigEntryV2 {
326338 Alias : alias ,
327339 IdentityFile : privateKeyPath ,
328340 User : user ,
329341 ProxyCommand : proxyCommand ,
330- Dir : workspace . GetProjectFolderPath () ,
342+ Dir : projPath ,
331343 }
332344 tmpl , err := template .New (alias ).Parse (SSHConfigEntryTemplateV2 )
333345 if err != nil {
@@ -344,11 +356,15 @@ func makeSSHConfigEntryV2(workspace entity.Workspace, privateKeyPath string, clo
344356 hostport := workspace .GetHostSSHPort ()
345357 hostuser := workspace .GetHostSSHUser ()
346358 if workspace .HostSSHProxyHostname == "" {
359+ projPath , err := workspace .GetProjectFolderPath ()
360+ if err != nil {
361+ return "" , breverrors .WrapAndTrace (err )
362+ }
347363 entry := SSHConfigEntryV2 {
348364 Alias : alias ,
349365 IdentityFile : privateKeyPath ,
350366 User : hostuser ,
351- Dir : workspace . GetProjectFolderPath () ,
367+ Dir : projPath ,
352368 HostName : hostname ,
353369 Port : hostport ,
354370 }
@@ -362,12 +378,16 @@ func makeSSHConfigEntryV2(workspace entity.Workspace, privateKeyPath string, clo
362378 }
363379 } else {
364380 proxyCommand := makeCloudflareSSHProxyCommand (cloudflaredBinaryPath , workspace .HostSSHProxyHostname )
381+ projPath , err := workspace .GetProjectFolderPath ()
382+ if err != nil {
383+ return "" , breverrors .WrapAndTrace (err )
384+ }
365385 entry := SSHConfigEntryV2 {
366386 Alias : alias ,
367387 IdentityFile : privateKeyPath ,
368388 User : hostuser ,
369389 ProxyCommand : proxyCommand ,
370- Dir : workspace . GetProjectFolderPath () ,
390+ Dir : projPath ,
371391 }
372392 tmpl , err := template .New (alias ).Parse (SSHConfigEntryTemplateV2 )
373393 if err != nil {
0 commit comments