Skip to content

Commit

Permalink
feat(apps): Update python commands (#310)
Browse files Browse the repository at this point in the history
* feat(apps): Update python commands
  • Loading branch information
janelletavares authored Apr 12, 2022
1 parent 245b068 commit 40b7f73
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion cmd/meroxa/turbine_cli/python/deploy.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
package turbinepy

import (
"fmt"
"os/exec"
"strconv"
"strings"
)

// TODO: Add a function that creates the needed structure for a python app

// TODO: Add a function to return whether the app has functions or not
// NeedsToBuild determines if the app has functions or not.
func NeedsToBuild(path string) (bool, error) {
cmd := exec.Command("turbine-py", "hasFunctions", path)
output, err := cmd.CombinedOutput()
if err != nil {
err := fmt.Errorf(
"unable to determine if the Meroxa Application at %s has a Process; %s",
path,
string(output))
return false, err
}
return strconv.ParseBool(strings.TrimSpace(string(output)))
}

// TODO: Add a function that actually creates the meroxa resources...

Expand Down
2 changes: 1 addition & 1 deletion cmd/meroxa/turbine_cli/python/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func Init(ctx context.Context, l log.Logger, name, path string) error {
cmd := exec.Command("turbine-py", "--generate", name, path)
cmd := exec.Command("turbine-py", "generate", name, path)
_, err := turbineCLI.RunCmdWithErrorDetection(ctx, cmd, l)
return err
}

0 comments on commit 40b7f73

Please sign in to comment.