fix: properly set the command for herokuish apps

This commit is contained in:
Jose Diaz-Gonzalez
2024-01-18 17:15:42 -05:00
parent cb62ab02f4
commit 7bce908c2d

View File

@@ -153,7 +153,7 @@ func enterPod(ctx context.Context, input EnterPodInput) error {
func extractStartCommand(input StartCommandInput) string {
command := ""
if input.ImageSourceType == "herokuish" {
command = "/start " + input.ProcessType
return "/start " + input.ProcessType
}
startCommandResp, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
@@ -162,14 +162,10 @@ func extractStartCommand(input StartCommandInput) string {
CaptureOutput: true,
StreamStdio: false,
})
if err == nil && startCommandResp.ExitCode == 0 {
if err == nil && startCommandResp.ExitCode == 0 && len(startCommandResp.Stdout) > 0 {
command = startCommandResp.Stdout
}
if input.ImageSourceType == "herokuish" {
return command
}
if input.ImageSourceType == "dockerfile" {
startCommandDockerfileResp, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "config-get",
@@ -177,7 +173,7 @@ func extractStartCommand(input StartCommandInput) string {
CaptureOutput: true,
StreamStdio: false,
})
if err == nil && startCommandDockerfileResp.ExitCode == 0 {
if err == nil && startCommandDockerfileResp.ExitCode == 0 && len(startCommandDockerfileResp.Stdout) > 0 {
command = startCommandDockerfileResp.Stdout
}
}