summaryrefslogtreecommitdiffstats
path: root/lib/apiv1
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-07-04 12:03:05 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-07-04 12:03:05 +0200
commit1efdb28f1bf9246004a7b145e8d91d89be785772 (patch)
treecd36e0c1358c8a4bf51f0923c53bf7473ea0b197 /lib/apiv1
parent75a75542d27d8485fc4c1749b51bd8e26320e982 (diff)
Report an error when sdkid not found.
Diffstat (limited to 'lib/apiv1')
-rw-r--r--lib/apiv1/exec.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/apiv1/exec.go b/lib/apiv1/exec.go
index 654ff64..6c70a98 100644
--- 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)