summaryrefslogtreecommitdiffstats
path: root/lib/apiv1/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/apiv1/exec.go')
-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)