Code Review
/
src
/
xds
/
xds-server.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
75a7554
)
Report an error when sdkid not found.
author
Sebastien Douheret
<sebastien.douheret@iot.bzh>
Tue, 4 Jul 2017 10:03:05 +0000
(12:03 +0200)
committer
Sebastien Douheret
<sebastien.douheret@iot.bzh>
Tue, 4 Jul 2017 10:03:05 +0000
(12:03 +0200)
lib/apiv1/exec.go
patch
|
blob
|
history
diff --git
a/lib/apiv1/exec.go
b/lib/apiv1/exec.go
index
654ff64
..
6c70a98
100644
(file)
--- a/
lib/apiv1/exec.go
+++ b/
lib/apiv1/exec.go
@@
-177,6
+177,12
@@
func (s *APIService) execCmd(c *gin.Context) {
if envCmd := s.sdks.GetEnvCmd(args.SdkID, prj.DefaultSdk); len(envCmd) > 0 {
cmd = append(cmd, envCmd...)
cmd = append(cmd, "&&")
+ } else {
+ // It's an error if no envcmd found while a sdkid has been provided
+ if args.SdkID != "" {
+ common.APIError(c, "Unknown sdkid")
+ return
+ }
}
cmd = append(cmd, "cd", prj.GetFullPath(args.RPath), "&&", args.Cmd)