Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apps): Update python commands #310

Merged
merged 2 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}