check if xgo and docker are installed

This commit is contained in:
konez2k
2020-02-20 16:46:52 +01:00
committed by Lea Anthony
parent da28683ddc
commit fbff822ea9

View File

@@ -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 {