(serviceDir, webCmd string)
| 50 | } |
| 51 | |
| 52 | func renderRunScript(serviceDir, webCmd string) error { |
| 53 | templatePath := filepath.Join(serviceDir, "app", "run.template") |
| 54 | runPath := filepath.Join(serviceDir, "app", "run") |
| 55 | |
| 56 | content, err := os.ReadFile(templatePath) |
| 57 | if err != nil { |
| 58 | return fmt.Errorf("reading run.template: %w", err) |
| 59 | } |
| 60 | replaced := strings.ReplaceAll(string(content), "{{ENTRYPOINT}}", webCmd) |
| 61 | |
| 62 | if err := os.WriteFile(runPath, []byte(replaced), 0755); err != nil { |
| 63 | return fmt.Errorf("writing app/run: %w", err) |
| 64 | } |
| 65 | return nil |
| 66 | } |
no test coverage detected