diff --git a/cmd/helpers.go b/cmd/helpers.go index 278e4560..9c363fe1 100644 --- a/cmd/helpers.go +++ b/cmd/helpers.go @@ -103,6 +103,16 @@ func BuildApplication(binaryName string, forceRebuild bool, buildMode string, pa if !fs.DirExists(buildDirectory) { fs.MkDir(buildDirectory) } + + // Check Docker + if err := CheckIfInstalled("docker"); err != nil { + return err + } + + // Check xgo + if err := CheckIfInstalled("xgo"); err != nil { + return err + } } else { // Check Mewn is installed err := CheckMewn(projectOptions.Verbose) @@ -320,6 +330,15 @@ func CheckWindres() (err error) { return nil } +// CheckIfInstalled returns if application is installed +func CheckIfInstalled(application string) (err error) { + programHelper := NewProgramHelper() + if !programHelper.IsInstalled(application) { + return fmt.Errorf("%s not installed. Ensure you have installed %s correctly", application, application) + } + return nil +} + // InstallFrontendDeps attempts to install the frontend dependencies based on the given options func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forceRebuild bool, caller string) error {