needsPython checks if any custom command references Python placeholders.
()
| 36 | |
| 37 | // needsPython checks if any custom command references Python placeholders. |
| 38 | func (c custom) needsPython() bool { |
| 39 | commands := append(c.CustomConfigure, c.CustomBuild...) |
| 40 | commands = append(commands, c.CustomInstall...) |
| 41 | |
| 42 | for _, command := range commands { |
| 43 | if strings.Contains(command, "${PYTHON_VENV_EXE}") || |
| 44 | strings.Contains(command, "${PYTHON_VENV_DIR}") || |
| 45 | strings.Contains(command, "${PYTHON_PATH}") { |
| 46 | return true |
| 47 | } |
| 48 | } |
| 49 | return false |
| 50 | } |
| 51 | |
| 52 | func (c custom) Name() string { |
| 53 | return "custom" |