diff --git a/wavesrv/pkg/cmdrunner/shparse.go b/wavesrv/pkg/cmdrunner/shparse.go index ac594068..55cdfbaf 100644 --- a/wavesrv/pkg/cmdrunner/shparse.go +++ b/wavesrv/pkg/cmdrunner/shparse.go @@ -241,6 +241,12 @@ func isRtnStateCmd(cmd syntax.Command) bool { return true } } + if arg0 == "conda" { + arg1 := getCallExprLitArg(callExpr, 1) + if arg1 == "activate" || arg1 == "deactivate" { + return true + } + } } else if _, ok := cmd.(*syntax.DeclClause); ok { return true } diff --git a/wavesrv/pkg/cmdrunner/shparse_test.go b/wavesrv/pkg/cmdrunner/shparse_test.go index a41670ea..ad9d9e16 100644 --- a/wavesrv/pkg/cmdrunner/shparse_test.go +++ b/wavesrv/pkg/cmdrunner/shparse_test.go @@ -60,4 +60,9 @@ func TestIsReturnStateCommand(t *testing.T) { testRSC(t, ". ./test", true) testRSC(t, "{ FOO=6; }", true) testRSC(t, "cd foo && ls -l", true) + testRSC(t, "ls -l && ./foo || git checkout main", true) + testRSC(t, "./foo || ./bar", false) + testRSC(t, ". foo.sh", true) + testRSC(t, "cd work; conda activate myenv", true) + testRSC(t, "asdf foo", true) }