Fixed /exec command (don't prefix command with exec binary).
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Thu, 24 Aug 2017 15:09:57 +0000 (17:09 +0200)
committerSebastien Douheret <sebastien.douheret@iot.bzh>
Thu, 24 Aug 2017 15:09:57 +0000 (17:09 +0200)
adding 'exec' prevents to use "script" syntax:
   xds-exec -c xds-config.env -- "cd build && cmake .."
But 'exec' binary is mandatory to allow to pass correctly signals to subprocess such as gdb.
As workaround, exec is set for now on client side (eg. in xds-gdb).

lib/apiv1/exec.go

index 4a591be..6300dba 100644 (file)
@@ -135,10 +135,13 @@ func (s *APIService) execCmd(c *gin.Context) {
                }
        }
 
-       // FIXME - SEB: exec prevents to use syntax:
-       //  xds-exec -l debug -c xds-config.env -- "cd build && cmake .."
        cmd = append(cmd, "cd", folder.GetFullPath(args.RPath))
-       cmd = append(cmd, "&&", "exec", args.Cmd)
+       // FIXME - add 'exec' prevents to use syntax:
+       //       xds-exec -l debug -c xds-config.env -- "cd build && cmake .."
+       //  but exec is mandatory to allow to pass correctly signals
+       //  As workaround, exec is set for now on client side (eg. in xds-gdb)
+       //cmd = append(cmd, "&&", "exec", args.Cmd)
+       cmd = append(cmd, "&&", args.Cmd)
 
        // Process command arguments
        cmdArgs := make([]string, len(args.Args)+1)